Photography — entry 024 of 25

Wallhaven

Verified Jul 2026

Wallhaven's v1 API exposes its wallpaper-sharing community catalog for search, browsing, and per-wallpaper metadata over plain GET requests, mirroring the site's own filters for tags, resolution, aspect ratio, purity, and sorting. Anonymous requests only return SFW results; registering a free account and passing its API key as a query parameter unlocks sketchy/NSFW purities plus access to a user's own settings, uploads, and favorites. There is no paid tier — the whole API is free, rate-limited to 45 requests per minute per the response headers.

Wallhaven's v1 API exposes its wallpaper-sharing community catalogue for search, browsing, and per-wallpaper metadata over plain GET requests, mirroring the filters (tags, resolution, aspect ratio, purity, sorting) the site itself offers. Anonymous requests reach the whole search and per-wallpaper surface and are not limited to SFW alone — an API key is only required to reach the NSFW purity tier or a user's own settings, uploads, and favorites.

wallpapersimage-searchcommunityuser-uploads
AuthenticationAPI KeySign up with the provider to obtain credentials.
HTTPSSupportedTraffic is encrypted in transit.
CORSDisabledBrowser calls need a server-side proxy.
PricingFreeNo paid tier — free for the documented use case.
FormatsJSONResponses can be requested as JSON.

GreatAPIs Score

Score64out of 100
Authentication15/25API key required
Pricing20/20Free to use
Docs0/20No docs or spec available
Formats9/15Single response format
Freshness20/20Verified within 6 months

Embed this badge

Scored 64 on greatapis.com
<a href="https://greatapis.com/api/wallhaven/"><img src="https://greatapis.com/badge/wallhaven.svg" alt="Scored 64 on greatapis.com"></a>

Auth quickstart

  1. Register a free account at wallhaven.cc and copy the API key from Account → Settings → API Key.
  2. Pass it as the apikey query parameter on any request, e.g. ?apikey=<key> appended to a search or wallpaper-detail URL — there is no header-based auth.
  3. A key is only required to unlock the NSFW purity tier or a user's own uploads/favorites/settings endpoints; SFW and sketchy search results (purity=100 or purity=110) both work unauthenticated.
Stored keyNo key stored

Your key is stored only in this browser (localStorage) and sent directly to the API — never to greatapis.

Search wallpapers anonymously

GEThttps://wallhaven.cc/api/v1/search?q=mountain&categories=100&purity=100&resolutions=5153x2899

200 application/json

{"data":[{"id":"e82xxr","url":"https:\/\/wallhaven.cc\/w\/e82xxr","short_url":"https:\/\/whvn.cc\/e82xxr","views":217,"favorites":10,"source":"https:\/\/unsplash.com\/fr\/photos\/une-lumiere-doree-illumine-les-montagnes-enneigees-et-escarpees-au-coucher-du-soleil-mac7AaETQX0","purity":"sfw","category":"general","dimension_x":5153,"dimension_y":2899,"resolution":"5153x2899","ratio":"1.78","file_size":2107070,"file_type":"image\/jpeg","created_at":"2026-08-04 04:30:07","colors":["#424153","#e7d8b1","#000000","#999999","#996633"],"path":"https:\/\/w.wallhaven.cc\/full\/e8\/wallhaven-e82xxr.jpg","thumbs":{"large":"https:\/\/th.wallhaven.cc\/lg\/e8\/e82xxr.jpg","original":"https:\/\/th.wallhaven.cc\/orig\/e8\/e82xxr.jpg","small":"https:\/\/th.wallhaven.cc\/small\/e8\/e82xxr.jpg"}}],"meta":{"current_page":1,"last_page":1,"per_page":24,"total":1,"query":"mountain","seed":null}}

resolutions=5153x2899 was added to this run's live probe specifically to narrow the plain q=mountain search (20,741 total matches, unfiltered) down to a single result, keeping the captured body small — not a fabricated shape. meta.total of 1 reflects that narrowed filter, not the full unfiltered match count; a bare q=mountain&categories=100&purity=100 search returns a 24-item data page and the same meta shape with total in the thousands.

Developer reference

Rate limit

45 requests per minute

Gotchas & limits

  • Anonymous access is not SFW-only, contrary to the intuitive assumption: a live unauthenticated probe with purity=111 (all three tiers requested) for mountain returned a mix of sfw and sketchy entries (23 and 1 respectively in a 24-item page) and zero nsfw ones — sketchy content is reachable with no key at all, only the NSFW tier is actually gated. A follow-up probe with purity=001 (NSFW only) confirmed the gate directly: it returned total: 0 with no apikey present.
  • The response carries x-ratelimit-limit: 45 and x-ratelimit-remaining headers (confirmed live: 45 and 44 respectively on a fresh probe) — the 45-per-minute cap applies per the API's own docs whether or not a key is present, so throttling is required even for anonymous use.
  • categories and purity are each a 3-digit bitmask string (general/anime/people, and sfw/sketchy/nsfw respectively), not named enum values — 100 means "first position only", not the number one hundred. A live probe swapping to categories=010 (anime only) for the same mountain query returned total: 835, a completely different count from categories=100's 20,741, confirming each digit gates a distinct, independent bucket rather than acting as a numeric range.
  • GET /w/{id} (the single-wallpaper endpoint, e.g. /w/e82xxr) returns the same wallpaper object nested one level deeper under a top-level data key, plus an uploader and full tags array that the search endpoint's list items omit — the two endpoints are not the same shape despite sharing most fields.
  • There is no CORS header on search responses — a live probe found no access-control-allow-origin on this endpoint, so it cannot be called directly from browser JS on another origin without a proxy.