Wallhaven API
Overview
Wallhaven is a curated wallpaper community, and its API lets you search and browse its large collection of high-resolution wallpapers by keyword, category, and resolution. Public wallpapers can be accessed without an API key, while an API key unlocks NSFW and personal favorites. It is a great API for building custom wallpaper apps or desktop clients.
Beginner Tip
Start with the /search endpoint without an API key to browse SFW wallpapers immediately — authentication is only needed to access adult-rated content or your personal account data.
Measurement Record
What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.
- Request
- GET https://wallhaven.cc/api/v1/search?q=nature&categories=010&purity=100&sorting=relevance
- Result
- HTTP 200 · application/json · 15,610 bytes · compressed
- Response time
- 219 ms (median of 3) · fastest 218 ms
- Transport
- TLSv1.3 · TLS_AES_256_GCM_SHA384 · certificate issued by Google Trust Services
- Browser CORS
- No Access-Control-Allow-Origin header — call it from a server, not the browser
- Rate limit
- 45 per window (44 remaining at test time)
- Served by
- cloudflare
- Recorded
- 2026-08-10
Fields Returned
Top-level fields present in the response we captured, with the type and value we actually received.
| Field | Type | Value received |
|---|---|---|
| id | string | p2o5yj |
| url | string (url) | https://wallhaven.cc/w/p2o5yj |
| short_url | string (url) | https://whvn.cc/p2o5yj |
| views | integer | 8470 |
| favorites | integer | 51 |
| source | string | |
| purity | string | sfw |
| category | string | anime |
| dimension_x | integer | 3200 |
| dimension_y | integer | 1800 |
| resolution | string | 3200x1800 |
| ratio | string | 1.78 |
| file_size | integer | 1234213 |
| file_type | string | image/jpeg |
Captured Response
Captured from a real request to https://wallhaven.cc/api/v1/search?q=nature&categories=010&purity=100&sorting=relevance on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.
{
"data": [
{
"id": "p2o5yj",
"url": "https://wallhaven.cc/w/p2o5yj",
"short_url": "https://whvn.cc/p2o5yj",
"views": 8470,
"favorites": 51,
"source": "",
"purity": "sfw",
"category": "anime",
"dimension_x": 3200,
"dimension_y": 1800,
"resolution": "3200x1800",
"ratio": "1.78",
"file_size": 1234213,
"file_type": "image/jpeg",
"…": "(4 more fields)"
}
],
"meta": {
"current_page": 1,
"last_page": 251,
"per_page": 24,
"total": 6007,
"query": "nature",
"seed": null
}
} Implementation Example
Calls a real endpoint of this API. Replace any placeholder credentials with your own key.
const url = "https://wallhaven.cc/api/v1/search?q=nature&categories=010&purity=100&sorting=relevance";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
headers: {
"X-API-Key": "YOUR_API_KEY"
}
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
How This API Fails
We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.
{
"error": "Not Found"
} Common Errors & Troubleshooting
Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.
Measured Score Breakdown
Live HTTP request to the API endpoint
Fully tested on Aug 10, 2026
Technical Specifications
Related Tags
Similar APIs
View All →APITemplate.io
APITemplate.io lets you generate images and PDFs on the fly by filling data into pre-designed templates.
CheetahO
CheetahO is an image optimization API that compresses and resizes photos without visible quality loss.
Dagpi
⭐ Beginner's PickDagpi is a free image manipulation API that applies filters, effects, and fun transformations to images with a single HTTP request.
PhotoRoom
PhotoRoom API uses AI to remove backgrounds from product and portrait photos, producing clean PNG images with transparent backgrounds suitable for e-commerce and marketing.
PlaceKeanu
⭐ Beginner's PickPlaceKeanu is a fun, free placeholder image API that serves Keanu Reeves photos in any size you specify in the URL with no API key or sign-up needed.