Developers

API reference

Complete reference for the Mungfali Image Search REST API — authentication, endpoints, parameters, responses, limits, and errors.

Mungfali exposes a single read-only search endpoint over HTTPS. Every successful call returns JSON with your query in name and an array of image objects in value. Create API keys in the dashboard after signing up.

Base URL

Send all requests to:

text
https://mungfali.net

The canonical search path is /v1/search. The same handler is also available at /api/v1/images/search for backward compatibility.

Authentication

API keys use the mgf_live_ prefix. Include your key on every request — keys are scoped to your organization and can be rotated from Dashboard → API Keys.

Security: Store keys in environment variables. Never embed them in mobile apps or front-end JavaScript; proxy requests through your server instead.

X-API-Key header (recommended)

bash
curl -s "https://mungfali.net/v1/search?q=mountains&count=20" \
  -H "X-API-Key: mgf_live_your_key_here"

Authorization Bearer

bash
curl -s "https://mungfali.net/v1/search?q=mountains&count=20" \
  -H "Authorization: Bearer mgf_live_your_key_here"

Response format

200 OK — JSON object with name (echo of your query) and value (array of 0–150 image objects).

json
{
  "name": "car",
  "value": [
    {
      "name": "Luxury Car Photos, Download The BEST Free Luxury Car Stock Photos & HD ...",
      "FamilyFriendly": true,
      "imageUrl": "https://images.pexels.com/photos/3729464/pexels-photo-3729464.jpeg?cs=srgb&dl=pexels-mikebirdy-3729464.jpg&fm=jpg",
      "hostUrl": "https://www.pexels.com/search/luxury%20car/",
      "contentSize": "1781235 B",
      "width": 5456,
      "height": 3632,
      "isTransparent": false,
      "accentColor": "C21C09"
    },
    {
      "name": "New Car HD Wallpapers - Wallpaper Cave",
      "FamilyFriendly": true,
      "imageUrl": "https://wallpapercave.com/wp/wp2775459.jpg",
      "hostUrl": "https://wallpapercave.com/new-car-hd-wallpaper",
      "contentSize": "215010 B",
      "width": 1440,
      "height": 900,
      "isTransparent": false,
      "accentColor": "B9AA12"
    }
  ]
}

Response fields

FieldScopeDescription
namerootThe search query string echoed in the response.
valuerootArray of image result objects (up to your requested count, max 150).
nameitemTitle or description of the image.
FamilyFriendlyitemWhether the image passed SafeSearch filtering.
imageUrlitemDirect URL of the image file.
hostUrlitemURL of the page where the image was found.
contentSizeitemApproximate file size of the image.
widthitemImage width in pixels.
heightitemImage height in pixels.
isTransparentitemTrue if the image has a transparent background (PNG).
accentColoritemDominant accent color as a hex string (without #).

Response headers

Successful responses include quota and rate-limit headers so you can monitor usage without an extra API call:

HeaderDescription
X-RateLimit-LimitMaximum API requests allowed per minute for your plan.
X-RateLimit-RemainingRequests remaining in the current one-minute window.
X-RateLimit-ResetISO 8601 timestamp when the per-minute rate limit window resets (only on 429 rate-limit responses).
X-Monthly-Quota-LimitTotal searches included in your plan for the current billing month.
X-Monthly-Quota-RemainingSearches remaining before monthly quota is exhausted.

Rate limits and quota

Each plan includes a monthly search quota and a per-minute rate limit. One successful search consumes one unit of monthly quota. When quota is exhausted, the API returns 429 with {"error":"Monthly quota exceeded"}. When the per-minute limit is hit, you receive 429 with rate-limit headers and {"error":"Rate limit exceeded"}.

PlanMonthly searchesRate limit
Free25010 / min
Starter10,00060 / min
Growth50,000300 / min
Pro150,0001,000 / min
Business1,000,0005,000 / min

See pricing for current plan pricing. Upgrade anytime from Dashboard → Billing.

Error responses

Errors return JSON with an error string and an appropriate HTTP status code:

json
{
  "error": "Invalid API key"
}
CodeStatusDescription
200OKRequest succeeded. JSON body contains name and value array.
400Bad RequestMissing or empty q parameter, or malformed query string.
401UnauthorizedAPI key missing, invalid, or revoked. Send X-API-Key or Authorization: Bearer.
402Payment RequiredOrganization has no active subscription. Upgrade or renew in the dashboard.
429Too Many RequestsMonthly search quota exhausted, or per-minute rate limit exceeded.
500Internal Server ErrorUpstream provider error or unexpected failure. Retry with exponential backoff.

Next steps

  • Examples — integration patterns and copy-paste code
  • SDKs — thin client wrappers for Node.js and Python
  • Dashboard docs — interactive reference with copy buttons (requires login)
  • Status — platform availability