API Endpoint: https://search-test.pictographic.ai/api/search
To use the API, send a POST request to the endpoint and ensure your requests are authenticated with your Api-Key included in the headers under the Api-Key field. Also, ensure the request body is formatted in JSON and includes parameters like search_term, color, stroke, styles, category, page, and take to customize the API response.
Body Schema:
- search_term: Search query string to match against description, concept, and tags.
- styles: Array of icon styles to filter by. Available styles: 'Gammaicon (gammaicon)', 'Pictoicon (pictoicon)'.
- color: Single color to filter results by.
- stroke: Stroke width parameter to filter results by.
- category: Single category to filter results by. Available categories: Abstract, Avatars, Business, Characteristics, Clothing & Accessories, Education, Emotions, Events, Finance, Food, Healthcare, Household, Nature, People, Places, State, Symbols, Technology, Themes, Vehicles.
- page: The page number to return. Default is 1.
- take: The number of icons to return per page (1-100).
You can customize SVG icons by appending query parameters to the image URL. The URL format is: https://iconscdn.pictographic.ai/image/file_id.svg?stroke=stroke&color=color
For example, to get an icon with blue color and stroke width of 25: https://iconscdn.pictographic.ai/image/0DoHXIkxLP7QwlzzZYbL.svg?stroke=25&color=blue
Styles
import requests
import json
response = requests.post(
"https://search-test.pictographic.ai/api/search",
headers={
"Api-Key": "kMsbNZ5t2CdH2UMg8oUABVFgZ7s8nW",
"Content-Type": "application/json",
},
data=json.dumps({
"search_term": "",
"styles": [
"gammaicon"
],
"page": 1,
"take": 10
})
)
if response.status_code == 200:
data = response.json()
print(f"Found {data['total']} icons")
for icon in data['data']:
print(f"Icon: {icon['concept']} - {icon['description']}")
# Get the SVG with custom styling
svg_url = f"https://iconscdn.pictographic.ai/image/{icon['id']}.svg?stroke=10&color=blue"
svg_response = requests.get(svg_url)
if svg_response.status_code == 200:
with open(f"{icon['id']}.svg", "w") as f:
f.write(svg_response.text)
else:
raise Exception(str(response.json()))