Documentation

API Reference

1. Image Search

API Endpoint: https://api.pictographic.io/api/get_pictures

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. field. Also, ensure the request body is formatted in JSON and includes parameters like search_term, color, background, styles, page, take, and type to customize the API response.

Body Schema:

- search_term : Enter search terms to find specific image content. You can use multiple terms separated by commas. The system will try each term in order - if no images are found for the first term, it will automatically move to the next term in your list.
For example: If you enter "schadenfreude, dog", and "schadenfreude" returns no images, the system will automatically search for "dog" instead.”

- styles : The styles of the images to return. Should be an array of the 'Essential (notion)', 'Lined (lined)', 'Old School (oldschool)', 'Purple (purple)', '3d (isometric-modern)', 'Memphis (flat-modern)', 'Ink Pen (inkmodern)', 'Illustrative (flatcool)', 'Cutie π (cartoon-cute)', 'Cartoon (cartoon-black-white)', 'Sketchy (isometric-sketch)', 'Blocky (minimal-line)', 'Simple (black-and-white-line)', .

- color : The colors of the images to return.

- background : The background of the images to return.

- page : The page number to return. Default is 1.

- take : The number of images to return per page.

- type : Type of return images (.png or .svg)

2. CDN/ Color Change

You can utilize the CDN to modify the color of the SVG images. Our current version support color change for Essential (notion), Ink Pen (inkmodern), Lined (lined) and Cartoon (cartoon-black-white).

Grab your SVG image URL from the API response and change the color by appending the color code to the URL. The URL should be in the format: https://api.pictographic.io/images/{style}/{file_id}?color={color}&background={background} where {style} is the style of image, {file_id} is the ID of the image and {color} is the color you want to change the image to, and the {background} color of the image

You can check all the valid color name codes from the W3Schools website. Or you can use the hexadecimal color code (without #) You can also change the color of the image to multiple colors by separating the colors with a comma.

For example, if you want to change the color and the background of the image with the style Ink Pen (inkmodern), ID u2swADiuLrzwnWX14prd to red and orange, and the background, you can modify thes URL: https://api.pictographic.io/images/inkmodern/u2swADiuLrzwnWX14prd.svg?color=red,orange&background=87CEEB

POST
/api/get_pictures

API-KEY

Search Term

Styles

Essential (notion)
Lined (lined)
Old School (oldschool)
Purple (purple)
3d (isometric-modern)
Memphis (flat-modern)
Ink Pen (inkmodern)
Illustrative (flatcool)
Cutie π (cartoon-cute)
Cartoon (cartoon-black-white)
Sketchy (isometric-sketch)
Blocky (minimal-line)
Simple (black-and-white-line)

Color

Background

Page

Take

Type

import requests
import json
response = requests.post(
    "https://api.pictographic.io/api/get_pictures",
    headers={
        "Api-Key": "qicN7r5q3QR5w3inowCKwc38Kat586",
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "search_term": "",
        "styles": [],
        "color":[ "#000000", "#FFFF00" ],
        "background":"#87CEEB",
        "page": 1,
        "take": 10,
        "type": "svg"
    })
)
if response.status_code == 200:
    with open("./pictographic-response.json", 'wb') as file:
        file.write(response.content)
else:
    raise Exception(str(response.json()))
Copy