For Developers and Businesses

FaceSearchAI offers a powerful API for integrating image-based search and privacy protection tools into your applications.

API Documentation

Requirements

  • Python 3
  • requests library

API Endpoints

1. Search API

Use the Search API to upload an image and retrieve related images along with their sources.

Endpoint: https://facesearchai.com/api/search

Method: POST

Headers:

  • api-key: Your API key (contact contact@facesearchai.com to obtain one)
  • accept: application/json

Payload:

  • Upload a file (formats: jpg, jpeg, png, webp)
  • File size limit: 10 MB
Example Code:
import requests

url = "https://facesearchai.com/api/search"
file_path = "path/to/your/image.jpg"

files = [
    ('file', (file_path, open(file_path, 'rb'), 'application/octet-stream'))
]

headers = {
    'api-key': 'your_api_key_here',
    'accept': 'application/json'
}

response = requests.post(url, headers=headers, files=files)

if response.status_code == 200:
    print(response.json())
else:
    print(f"Error: {response.status_code}")
Sample Response:
{
    "UST_time": 1735498671,
    "results": [
        {
            "adultContent": false,
            "sourceUrl": "https://example.com/article1",
            "imageUrl": "https://example.com/image1.png"
        },
        {
            "adultContent": false,
            "sourceUrl": "https://example.com/article2",
            "imageUrl": "https://example.com/image2.jpg"
        }
    ]
}

2. Profile Info API

Use the Profile Info API to retrieve details about your account, such as available credits and subscription information.

Endpoint: https://facesearchai.com/api/info

Method: GET

Headers:

  • api-key: Your API key
Example Code:
import requests

url = "https://facesearchai.com/api/info"

headers = {
    'api-key': 'your_api_key_here'
}

response = requests.get(url, headers=headers)

if response.status_code == 200:
    print(response.json())
else:
    print(f"Error: {response.status_code}")
Sample Response:
{
    "email": "user@domain.com",
    "monthly_credits": 20000,
    "daily_credits": 4000,
    "daily_searches_used": 1000,
    "monthly_searches_used": 10000,
    "subscribe_date": "2024-12-29T12:42:47.104536Z"
}

Error Handling

  • 401 Unauthorized: Verify your API key
  • 413 Payload Too Large: Ensure the file size is below 10 MB
  • 415 Unsupported Media Type: Use only supported file formats (jpg, jpeg, png, webp)
  • 429 Too Many Requests: Monitor your daily or monthly credit usage

Face Search AI empowers developers and users with innovative image search and privacy protection tools. Integrate today and revolutionize the way you manage and protect your images.