Images API Reference
Query NestDaddy's image index and get structured metadata — image URL, dimensions, alt text, source URL, country, and more. Perfect for AI/ML training datasets, visual search apps, and content pipelines.
Authentication
Every request must include your API key via the key query parameter or the X-API-Key header.
GET /api/v1/images?key=nd_live_xxxxxxxxxxxxxxxx&q=cats
GET /api/v1/images?q=cats X-API-Key: nd_live_xxxxxxxxxxxxxxxx
Quick Start
Make your first image search in under 60 seconds.
curl "https://nestdaddy.com/api/v1/images?key=YOUR_API_KEY&q=cats&limit=20"
import requests API_KEY = "YOUR_API_KEY" BASE_URL = "https://nestdaddy.com/api/v1/images" response = requests.get(BASE_URL, params={ "key": API_KEY, "q": "cats", "limit": 20, "page": 1, }) data = response.json() for img in data["results"]: print(img["image_url"], img["width"], "x", img["height"])
const res = await fetch( `https://nestdaddy.com/api/v1/images?key=${API_KEY}&q=cats&limit=20` ); const data = await res.json(); data.results.forEach(img => { console.log(img.image_url, `${img.width}x${img.height}`); });
$url = "https://nestdaddy.com/api/v1/images?" . http_build_query([ 'key' => 'YOUR_API_KEY', 'q' => 'cats', 'limit' => 20, ]); $data = json_decode(file_get_contents($url), true); foreach ($data['results'] as $img) { echo $img['image_url'] . "\n"; }
Endpoint
All requests use HTTPS GET. Parameters are passed as URL query strings. CORS is enabled for all origins.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| key | string | Required | — | Your NestDaddy API key |
| q | string | Required | — | Search query for image alt text and surrounding page content |
| limit | integer | Optional | 20 | Results per page. Min: 1, Max: 100. |
| page | integer | Optional | 1 | Page number for pagination. Min: 1. |
| min_width | integer | Optional | — | Filter: minimum image width in pixels. |
| min_height | integer | Optional | — | Filter: minimum image height in pixels. |
| domain | string | Optional | — | Filter by source domain (partial match). E.g. unsplash.com |
| country | string | Optional | — | ISO 3166-1 country code. E.g. US, MY, SG |
| format | string | Optional | json | json (default) or jsonl (newline-delimited, ideal for ML pipelines). |
Response
Successful responses return HTTP 200 with a JSON body.
{
"success": true,
"query": "cats",
"page": 1,
"limit": 20,
"count": 20,
"results": [
{
"image_url": "https://example.com/images/cat.jpg",
"alt_text": "A fluffy orange tabby cat on a windowsill",
"title": "Cute cats gallery",
"width": 1920,
"height": 1080,
"aspect_ratio": 0.56,
"source_url": "https://example.com/cats-gallery",
"source_title": "Cute Cats Gallery | Example",
"domain": "example.com",
"country": "US",
"discovered_at": "2024-07-12T08:30:00Z"
}
],
"stats": {
"took_ms": 45,
"total_indexed": 34567890
}
}
Result Object Fields
| Field | Type | Description |
|---|---|---|
| image_url | string | Direct URL to the image file |
| alt_text | string | null | HTML alt attribute of the image |
| title | string | null | Title of the source page or image element |
| width | integer | null | Image width in pixels (if known) |
| height | integer | null | Image height in pixels (if known) |
| aspect_ratio | float | null | Height / width ratio (e.g. 0.56 for 16:9) |
| source_url | string | URL of the web page where this image was found |
| source_title | string | null | Title of the source web page |
| domain | string | Root domain of the source page |
| country | string | null | ISO 3166-1 country code (e.g. US) |
| discovered_at | string | null | ISO 8601 timestamp when NestDaddy indexed this image |
Errors
All errors return a JSON body with success: false and an error message.
{
"success": false,
"error": "Query parameter \"q\" is required"
}
| HTTP Status | Cause |
|---|---|
| 400 | The q parameter is absent or empty |
| 401 | Invalid, missing, or deactivated API key |
| 401 | Monthly request quota exceeded |
| 401 | Subscription is paused or expired |
| 500 | Server-side error — contact [email protected] |
Code Examples
Filter by minimum resolution (HD images)
# HD images only (1280x720 minimum) response = requests.get(BASE_URL, params={ "key": API_KEY, "q": "nature landscapes", "limit": 50, "min_width": 1280, "min_height": 720, })
curl "https://nestdaddy.com/api/v1/images?key=YOUR_KEY&q=nature+landscapes&min_width=1280&min_height=720&limit=50"
Filter by country
response = requests.get(BASE_URL, params={ "key": API_KEY, "q": "kuala lumpur", "country": "MY", "limit": 30, })
const params = new URLSearchParams({ key: API_KEY, q: "kuala lumpur", country: "MY", limit: "30" }); const data = await (await fetch(`https://nestdaddy.com/api/v1/images?${params}`)).json();
Pagination
Use the page parameter together with limit to walk through result sets.
# Collect 500 images across 5 pages all_images = [] for page in range(1, 6): data = requests.get(BASE_URL, params={ "key": API_KEY, "q": "food photography", "limit": 100, "page": page, }).json() if not data.get("results"): break all_images.extend(data["results"]) print(f"{len(all_images)} images collected")
async function collectImages(query, pages = 5) { const all = []; for (let p = 1; p <= pages; p++) { const data = await (await fetch( `https://nestdaddy.com/api/v1/images?key=${API_KEY}&q=${encodeURIComponent(query)}&limit=100&page=${p}` )).json(); if (!data.results?.length) break; all.push(...data.results); } return all; }
Filtering
Combine multiple filter parameters to narrow your results. All filters are applied server-side before pagination.
| Use Case | Parameters |
|---|---|
| HD images only (≥1280×720) | min_width=1280&min_height=720 |
| Square images (for thumbnails) | Filter client-side on aspect_ratio between 0.9–1.1 |
| From specific source site | domain=flickr.com |
| From specific country | country=US |
JSONL Format
Request format=jsonl for newline-delimited JSON — one image object per line. Loads directly into pandas, HuggingFace datasets, or any JSONL reader.
curl "https://nestdaddy.com/api/v1/images?key=YOUR_KEY&q=cats&limit=100&format=jsonl" \
-o cats.jsonl
import pandas as pd, requests, io response = requests.get(BASE_URL, params={ "key": API_KEY, "q": "cats", "limit": 100, "format": "jsonl", }) df = pd.read_json(io.StringIO(response.text), lines=True) print(df[["image_url", "width", "height", "alt_text"]].head())
from datasets import load_dataset import requests, tempfile, os resp = requests.get(BASE_URL, params={ "key": API_KEY, "q": "cats", "limit": 100, "format": "jsonl" }) with tempfile.NamedTemporaryFile(mode="w", suffix=".jsonl", delete=False) as f: f.write(resp.text); tmp = f.name ds = load_dataset("json", data_files=tmp, split="train") os.unlink(tmp) print(ds)
Rate Limits
Rate limits apply per API key per minute. Exceeding the limit returns 429 Too Many Requests.
limit=100 with pagination rather than many small requests to stay within rate limits efficiently.Monthly Quota
Each plan includes a monthly request quota. Image API and Search API share the same quota pool.
| Plan | Monthly Requests | Max / Request | Price |
|---|---|---|---|
| Free Trial | 500 | 20 | $0 / 7 days |
| Starter | 10,000 | 100 | $14.99 / mo |
| Growth | 50,000 | 100 | $39.99 / mo |
| Pro | 200,000 | 100 | $99.99 / mo |
Need a custom plan for large-scale training data? Contact us for enterprise pricing.