Skip to content

Poly Haven API ​

Server routes that proxy requests to the Poly Haven material library API.

Why Proxy? ​

The Poly Haven API is called through server routes to:

  • Add server-side caching
  • Handle rate limiting
  • Normalize response format
  • Keep API details server-side

Search for textures/materials.

Query Parameters ​

ParamTypeDescription
qstringSearch query
typestringAsset type (default: textures)
categoriesstringComma-separated category filter
limitnumberMax results

Response ​

Returns normalized material objects with id, name, tags, categories, thumbnail_url, and download stats.


GET /api/polyhaven/categories ​

Get available texture categories.

Response ​

json
{
  "categories": ["brick", "concrete", "fabric", "marble", "metal", "stone", "tile", "wood", ...]
}

GET /api/polyhaven/info/[id] ​

Get detailed asset information.

Parameters ​

ParamTypeDescription
idstringPoly Haven asset slug

GET /api/polyhaven/files/[id] ​

Get asset file URLs for different resolutions and formats.

Parameters ​

ParamTypeDescription
idstringPoly Haven asset slug

Response ​

Returns texture maps (diffuse, normal, roughness, etc.) at various resolutions (1K, 2K, 4K).

Source ​

server/api/polyhaven/

Built with VitePress