API Documentation


Endpoints

1. Search Images

Search for images using various filters and parameters.

Endpoint: GET /api/search or GET /api/search/{phrase}

Parameters:

Parameter Type Required Default Description
phrase string Yes - Search query for finding images
offset integer No 0 Offset for pagination (starting position in results)
limit integer No 50 Number of results per page (max: 100)
type string No all Type of content: all, images, vector, stock, editorial
orientation string No - Image orientation: portrait, landscape, square, panorama, skyscraper
synth string No - AI-generated images: only (only AI images), exclude (exclude AI images)
safe boolean No true Filter adult/explicit content: true, false, yes, no

Example Requests:

# Basic search
curl -X GET "https://client-api.smarterpix.com/api/search?phrase=nature" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Search with pagination
curl -X GET "https://client-api.smarterpix.com/api/search?phrase=mountains&offset=20&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Search with filters
curl -X GET "https://client-api.smarterpix.com/api/search?phrase=sunset&orientation=landscape&type=images&safe=yes" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Using path parameter
curl -X GET "https://client-api.smarterpix.com/api/search/nature?limit=25" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response:

{
  "images": [
    {
    }
  ],
  "total": 1500,
  "offset": 0,
  "limit": 50
}

2. Get Image Details

Retrieve detailed information about a specific image.

Endpoint: GET /api/details or GET /api/details/{id}

Parameters:

Parameter Type Required Description
id string Yes Unique identifier of the image (format: letter followed by digits, e.g., A123456789)

Example Requests:

# Using path parameter
curl -X GET "https://client-api.smarterpix.com/api/details/A123456789" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Using query parameter
curl -X GET "https://client-api.smarterpix.com/api/details?id=A123456789" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response:

{
  "id": "A123456789",
  "title": "Beautiful Mountain Landscape",
  "description": "Scenic view of mountains at sunset with vibrant colors",
  "keywords": ["mountain", "landscape", "sunset", "nature"],
  ......
}

Error Response (404 Not Found):

{
  "status": 404,
  "message": "not found"
}

3. Download Image

Download an image file.

Endpoint: GET /api/download or GET /api/download/{id}

Parameters:

Parameter Type Required Description
id string Yes Unique identifier of the image to download
size string No Desired image size: small (default: small)
preview boolean No If true, returns a preview version of the EPS image

Example Requests:

# Using path parameter
curl -X GET "https://client-api.smarterpix.com/api/download/A123456789" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o image.jpg

# Using query parameter
curl -X GET "https://client-api.smarterpix.com/api/download?id=A123456789" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o image.jpg

Response:

The endpoint returns the actual image file with appropriate headers:

Content-Type: image/jpeg
Content-Disposition: attachment; filename="image"

Error Response (404 Not Found):

{
  "status": 404,
  "message": "not found"
}

Error Response (500 Server Error):

{
  "message": "Failed to download image.",
  "error": "Error details here"
}