# 3D Asset Search: Poly Haven, ambientCG, Sketchfab (`jet_elation/unified-3d-pbr-asset-search`) Actor

One request searches Poly Haven, ambientCG, and Sketchfab, then returns a normalized JSON schema with license signals, direct download URLs, and AI-agent-friendly metadata.

- **URL**: https://apify.com/jet_elation/unified-3d-pbr-asset-search.md
- **Developed by:** [y u](https://apify.com/jet_elation) (community)
- **Categories:** Developer tools, Games, For creators
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 asset returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

Search [**Poly Haven**](https://polyhaven.com), [**ambientCG**](https://ambientcg.com), and [**Sketchfab**](https://sketchfab.com) in one request and get back one clean, AI-friendly JSON schema for 3D models, PBR textures, and HDRIs. **3D Asset Search: Poly Haven, ambientCG, Sketchfab** is a fast, browser-free 3D asset search API and Apify Actor that combines license signals, commercial-use flags, thumbnail URLs, source pages, and direct download URLs where the public APIs allow them.

Instead of opening three websites, comparing three license pages, and manually collecting texture or model links, send a single query such as `wooden chair`. The Actor searches all three sources, normalizes the results, applies your license and resolution filters, and writes one record per asset to the Apify dataset. AI agents can call the same Actor through the **Apify MCP Server** with only a query.

**Apify Store:** [3D Asset Search: Poly Haven, ambientCG, Sketchfab](https://apify.com/jet_elation/unified-3d-pbr-asset-search)\
**MCP tool name:** `jet_elation--unified-3d-pbr-asset-search`

> **Poly Haven attribution:** this Actor and its output are **Powered by Poly Haven**. Poly Haven assets are CC0.

### What is the 3D Asset Search API?

This is a search and normalization layer, not another asset host. It uses the official public APIs in a polite, server-side way:

- **Poly Haven** `/assets` and `/files/{id}` endpoints
- **ambientCG** API v2 `full_json` endpoint
- **Sketchfab** public Search API v3

No Playwright, Chromium, browser automation, or proxy is used. Requests are plain Node.js HTTP calls with hard timeouts and limited retries. Poly Haven details are fetched only for the requested top results, with a maximum concurrency of five. Sketchfab pagination is sequential, and every API call uses a descriptive User-Agent.

The result is useful for:

- 3D asset discovery and mood boards
- game, XR, archviz, and product visualization pipelines
- PBR material search APIs
- AI agents that need commercial-safe CC0 assets
- HDRI and model catalog enrichment
- license auditing and download-link collection

### Key features

- **One query, three sources:** Poly Haven, ambientCG, and Sketchfab in one Actor run.
- **Unified JSON:** every result has the same `id`, `source`, `license`, `downloads`, and `metadata` fields.
- **Commercial-use checks:** CC0, CC BY, CC BY-SA, and non-commercial Sketchfab licenses are normalized into `commercialUseAllowed` and `attributionRequired`.
- **Direct downloads:** Poly Haven and ambientCG return unauthenticated file URLs. Resolution fallback selects the closest available file and reports the actual resolution.
- **MCP-ready input:** `query` is the only required field; all other inputs have sensible defaults for AI agents.
- **Pay-per-event:** one `asset-returned` charge per valid dataset record, with automatic stopping at the user's spending limit.
- **Source isolation:** if one API times out or returns a transient error, the remaining sources still return results. Per-source status is stored in the `SUMMARY` key-value record.
- **Offline mock mode:** `useMockData: true` runs the full normalization and charging path without network access.
- **No browser or proxy costs:** pure HTTP JSON communication and a 512 MB default memory limit.

### Supported sources, licenses, and download coverage

| Source | Asset types | License handling | Direct download |
| --- | --- | --- | --- |
| **Poly Haven** | HDRIs, PBR textures, 3D models | CC0; `commercialUseAllowed: true`, `attributionRequired: false`; output includes `Powered by Poly Haven` | Yes, unauthenticated CDN URLs |
| **ambientCG** | PBR materials, HDRIs, and the API's 3D model data type | CC0; commercial use allowed; attribution not required | Yes, unauthenticated ZIP URLs |
| **Sketchfab** | 3D models | Per-model Creative Commons or platform license; non-commercial licenses can be excluded or flagged | **No.** Public search returns metadata only |

**Sketchfab download limitation:** Sketchfab's public search API does not expose binary download URLs. Sketchfab records are always returned with `directDownloadAvailable: false` and `downloads: []`. To download the model, open `previewPageUrl` or use Sketchfab's download API with a user OAuth 2.0 access token. This is also recorded in `metadata.downloadNote` so AI agents do not confuse Sketchfab results with Poly Haven or ambientCG direct links.

### Input parameters

Only `query` is required. The input schema is designed so that an MCP client or AI agent can call the Actor with a single string.

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `query` | string | prefill: `wooden chair` | Search text. Poly Haven is filtered locally; ambientCG and Sketchfab use their search endpoints. |
| `sources` | array | `["polyhaven", "ambientcg", "sketchfab"]` | Choose one or more sources. |
| `assetType` | string | `all` | `all`, `models`, `textures`, or `hdris`. |
| `preferredResolution` | string | `1k` | `1k`, `2k`, or `4k`. The closest available resolution is used when the exact one does not exist. |
| `commercialSafeOnly` | boolean | `true` | Excludes non-commercial results. For Sketchfab, the query is restricted to CC0, CC BY, and CC BY-SA, then verified locally. |
| `cc0Only` | boolean | `false` | Keeps only CC0 assets. |
| `maxResults` | integer | `20` | Maximum dataset records, from 1 to 200. Results are interleaved fairly across sources. |
| `useMockData` | boolean | `false` | Uses `fixtures/mock_data.json` and makes no external requests. Useful for offline tests and PPE debugging. |

Example minimal MCP-friendly input:

```json
{
  "query": "wooden chair"
}
```

Example with filters:

```json
{
  "query": "mossy stone wall",
  "sources": ["polyhaven", "ambientcg"],
  "assetType": "textures",
  "preferredResolution": "2k",
  "commercialSafeOnly": true,
  "cc0Only": true,
  "maxResults": 25
}
```

### Output format

The Actor writes one normalized record per asset to the default dataset and writes run diagnostics to the `SUMMARY` record in the default key-value store.

```json
{
  "id": "polyhaven:WoodenChair_01",
  "source": "polyhaven",
  "sourceAssetId": "WoodenChair_01",
  "name": "Wooden Chair 01",
  "assetType": "model",
  "license": "CC0",
  "commercialUseAllowed": true,
  "attributionRequired": false,
  "attributionText": "Powered by Poly Haven (Asset is CC0)",
  "tags": ["wood", "prop", "vintage", "furniture", "chair", "gothic", "victorian", "decorative"],
  "thumbnailUrl": "https://cdn.polyhaven.com/asset_img/thumbs/WoodenChair_01.png?width=256&height=256&format=webp&v=d6d73c04",
  "previewPageUrl": "https://polyhaven.com/a/WoodenChair_01",
  "directDownloadAvailable": true,
  "downloads": [
    {
      "resolution": "1k",
      "format": "gltf",
      "mapType": "gltf",
      "url": "https://dl.polyhaven.org/file/ph-assets/Models/gltf/1k/WoodenChair_01/WoodenChair_01_1k.gltf",
      "sizeBytes": 2705,
      "md5": "a540903a19cd0fd5afaaa21c4b772204",
      "include": [
        "textures/WoodenChair_01_diff_1k.jpg",
        "textures/WoodenChair_01_nor_gl_1k.jpg",
        "WoodenChair_01.bin"
      ]
    },
    {
      "resolution": "1k",
      "format": "jpg",
      "mapType": "diffuse",
      "url": "https://dl.polyhaven.org/file/ph-assets/Models/jpg/1k/WoodenChair_01/WoodenChair_01_diff_1k.jpg",
      "sizeBytes": 147990,
      "md5": "7de73aa8fef4c04d1e0d91acd3a8547d"
    },
    {
      "resolution": "1k",
      "format": "jpg",
      "mapType": "roughness",
      "url": "https://dl.polyhaven.org/file/ph-assets/Models/jpg/1k/WoodenChair_01/WoodenChair_01_rough_1k.jpg",
      "sizeBytes": 100070
    }
  ],
  "metadata": {
    "downloadCount": 19668,
    "faceCount": null,
    "authors": ["Jake Mobley"],
    "sourcePageUrl": "https://polyhaven.com/a/WoodenChair_01",
    "apiAttribution": "Powered by Poly Haven"
  }
}
```

Download objects may also include optional `variant`, `md5`, and `include` fields. ambientCG ZIPs use `mapType: "zip"` and may include a package variant such as `"1K-PNG"`.

#### Run summary

`SUMMARY` contains each source's status (`success`, `partial`, `empty`, `error`, or `skipped`), matched count, returned count, item errors, duration, and an explanatory message. It also contains totals, billing state, attribution notices, and notes for degraded sources.

```json
{
  "actor": "unified-3d-pbr-asset-search",
  "query": "wooden chair",
  "mode": "live",
  "sourceStatuses": {
    "polyhaven": { "status": "success", "matched": 3, "itemErrors": 0, "returned": 2, "durationMs": 1820 },
    "ambientcg": { "status": "success", "matched": 2, "itemErrors": 0, "returned": 2, "durationMs": 940 },
    "sketchfab": { "status": "success", "matched": 4, "itemErrors": 0, "returned": 2, "durationMs": 610 }
  }
}
```

### Use from AI agents with Apify MCP

The Actor is callable through the [Apify MCP Server](https://mcp.apify.com). The Actor ships an explicit output schema that points agents to the normalized dataset and the `SUMMARY` record, so clients can discover both the results and the per-source diagnostics. For a focused setup, load only this Actor as a tool:

```json
{
  "mcpServers": {
    "apify-unified-3d-search": {
      "type": "http",
      "url": "https://mcp.apify.com?tools=jet_elation/unified-3d-pbr-asset-search"
    }
  }
}
```

The hosted server recommends OAuth. If your client uses a bearer token, add:

```json
{
  "headers": {
    "Authorization": "Bearer YOUR_APIFY_TOKEN"
  }
}
```

**Example agent prompt:** “Find a CC0 wooden chair 3D model with a direct glTF URL and commercial-use license. Return the top 3 with thumbnails and licenses.”

**Combined toolset:** [Jet Elation AI Tools](https://github.com/Matsuda681/jet-elation-ai-tools) — five Apify Actors in one MCP connection.

Once connected, the agent can make a minimal call:

```json
{
  "query": "wooden chair"
}
```

Or a more targeted call:

```json
{
  "query": "forest hdri",
  "sources": ["polyhaven", "ambientcg"],
  "assetType": "hdris",
  "preferredResolution": "4k",
  "commercialSafeOnly": true,
  "maxResults": 10
}
```

The input schema makes the contract explicit to the model: query is required, every other property has a default, license filters are described in plain English, and output fields have descriptions and examples. Agents can use the returned `previewPageUrl` and `downloads` array directly, and can inspect `metadata.downloadNote` before suggesting a Sketchfab download.

### Pricing (Pay-Per-Event)

The intended pricing event is documented in `.actor/pay_per_event.json`:

- Event: `asset-returned`
- Price: **$0.005 per valid asset record**
- Recommended minimum user spend limit: **$0.01**

The Actor pushes a record to the dataset first and then calls `Actor.charge({ eventName: 'asset-returned', count: 1 })`. It never charges for empty responses, filtered-out records, normalization failures, failed source requests, or records that are not written. If the returned `chargedCount` is `0`, or the event charge limit has been reached, the Actor stops immediately and exits cleanly after writing the run summary.

When configuring monetization in Apify Console, add the `asset-returned` event and remove or zero the synthetic `apify-default-dataset-item` event if you do not want a second per-item charge. The optional `apify-actor-start` event can be kept according to your pricing strategy.

Local runs simulate no charging unless `ACTOR_TEST_PAY_PER_EVENT=true` is set. This lets you test the full PPE code path without billing. On the platform, the user's `maxTotalChargeUsd` is enforced by the SDK.

### Why the results are normalized

- Poly Haven returns an **object keyed by asset ID**, not an array. This Actor iterates with `Object.entries()`, performs local token matching across ID, name, description, categories, and tags, sorts by download count, and only then fetches file metadata for the shortlisted assets.
- Poly Haven file metadata is deeply nested by map name, resolution, and format. The adapter walks those objects, prefers the requested resolution, falls back to the nearest available one, and preserves MD5 checksums and include paths when present.
- ambientCG returns download data under `downloadFolders.default.downloadFiletypeCategories.zip.downloads`. The adapter safely walks that structure and picks ZIPs at the requested resolution.
- Sketchfab search results do not contain direct download URLs. The Actor never invents one.

### Local development and testing

Requirements: Node.js 20 or newer for the Actor itself. Node.js 24 is recommended when using the latest Apify CLI; the container uses the Node 20 Apify base image.

```bash
npm install
npm run build
npm test
npx apify-cli@latest validate-schema
```

`npm test` runs 15 automated checks. The unit suite covers MCP input defaults, query matching, asset-type filters, resolution fallback (including rejection of Poly Haven backplate IDs as resolutions), Poly Haven model/HDRI/texture extraction, ambientCG ZIP variants, Sketchfab CC0/BY/BY-SA/NC license handling, and pre-billing record validation. The end-to-end suite launches the real Actor process in an isolated local storage directory and verifies:

- an eight-record offline run with validated output records and per-source status,
- one simulated PPE charge per returned record,
- clean stopping at `ACTOR_MAX_TOTAL_CHARGE_USD`,
- continued results from ambientCG and Sketchfab when Poly Haven is unreachable,
- a diagnostic `SUMMARY` record for invalid input.

The included GitHub Actions workflow runs the tests on Node.js 20 and 24, validates all Apify schemas, and builds the Docker image.

The repository includes `input.example.json` for a reproducible offline run:

```bash
npx apify-cli@latest run --input-file=./input.example.json
```

That input uses `useMockData: true` and writes results under `storage/datasets/default/`. The run summary is at `storage/key_value_stores/default/SUMMARY.json`. Using an input file avoids Windows PowerShell quoting problems with inline JSON.

Test the pay-per-event code path locally.

PowerShell:

```powershell
$env:ACTOR_TEST_PAY_PER_EVENT = "true"
npx apify-cli@latest run --input-file=./input.example.json
```

Bash:

```bash
ACTOR_TEST_PAY_PER_EVENT=true npx apify-cli@latest run --input-file=./input.example.json
```

The run summary's `totals.charged` field shows how many simulated charges were accepted. Depending on the SDK version, the local SDK may also write a `charging-log` dataset for inspection.

To test the live public APIs, copy `input.example.json` to a temporary file, set `useMockData` to `false`, and run it with the same `--input-file` command.

Build the production container:

```bash
docker build -t unified-3d-pbr-asset-search .
```

### Deploy to Apify Store

1. Run `npx apify-cli@latest login`.
2. Run `npx apify-cli@latest push`.
3. Open the Actor in Apify Console and review the input, dataset schema, and README.
4. Open **Publishing → Monetization**, select **Pay per event**, and add the `asset-returned` event with the price from `.actor/pay_per_event.json`.
5. Set `asset-returned` as the primary event and configure the minimum spend limit.
6. Test a run with a small `maxResults`, then publish to Apify Store.

The `SUMMARY` key-value record is intentionally machine-readable so MCP clients and automation can diagnose partial source failures without parsing logs.

### FAQ

#### Does this Actor download 3D files?

No. It returns direct download URLs for Poly Haven and ambientCG. Sketchfab binaries require authentication and are never downloaded by this Actor.

#### Are Poly Haven and ambientCG assets really free for commercial use?

Both sources primarily publish CC0 assets. This Actor reports the source license as CC0 and flags commercial use as allowed. Always verify the asset page before production use.

#### Why are some Sketchfab results missing?

The default `commercialSafeOnly: true` removes non-commercial licenses. Sketchfab also limits search result pages to 24 models, so the adapter paginates politely until `maxResults` is reached or no next page exists.

#### Why does a result show a different resolution than requested?

Some assets do not have the requested resolution. The Actor selects the closest available resolution and records the actual resolution in every download object.

#### Can I use this as a 3D asset API?

Yes. Run it through the Apify API or load it as an MCP tool. The unified schema is designed for downstream automation, and the dataset schema gives agents field-level descriptions.

#### What happens when one API is down?

That source is marked `error` or `partial` in `SUMMARY`, while the other sources continue. The Actor exits successfully if at least one requested source completed without an error.

### Legal and attribution

- **Poly Haven:** assets are CC0. API usage and this output are **Powered by Poly Haven**. See [polyhaven.com](https://polyhaven.com).
- **ambientCG:** assets are CC0; credit is appreciated. See [ambientcg.com](https://ambientcg.com).
- **Sketchfab:** licenses vary by model. This Actor preserves the source license label, infers a normalized license slug, and exposes commercial-use and attribution flags. See [sketchfab.com](https://sketchfab.com).
- This Actor is not affiliated with Poly Haven, ambientCG, or Sketchfab. License metadata is informational, not legal advice. Verify the source page before commercial use.
- Source APIs, file URLs, and license terms can change. If an upstream API changes its response shape, the Actor isolates the failing source and records the error in `SUMMARY`.

**Powered by Poly Haven.**

# Actor input Schema

## `query` (type: `string`):

What to search for across 3D models, PBR textures, and HDRIs (for example: 'wooden chair', 'mossy stone wall', 'forest HDRI'). Poly Haven results are filtered locally by this query; ambientCG and Sketchfab use their official search endpoints.

## `sources` (type: `array`):

Choose one or more free public sources. Poly Haven and ambientCG provide CC0 assets with direct download links. Sketchfab provides search metadata only; its binary downloads require the official page or an OAuth token.

## `assetType` (type: `string`):

Filter by asset kind. 'models' returns 3D models, 'textures' returns PBR materials/textures, 'hdris' returns environment maps, and 'all' searches every supported kind.

## `preferredResolution` (type: `string`):

Preferred texture/HDRI/model resolution. If a source does not offer this exact resolution, the adapter falls back to the closest available resolution and reports the actual resolution for every download.

## `commercialSafeOnly` (type: `boolean`):

Keep only records that are safe for commercial use. Poly Haven and ambientCG are CC0. For Sketchfab, this restricts the upstream query to CC0, CC BY, and CC BY-SA and also verifies the returned license locally. Turn off to include non-commercial Sketchfab results with `commercialUseAllowed: false`.

## `cc0Only` (type: `boolean`):

Keep only CC0 records. This removes Sketchfab CC BY, CC BY-SA, and non-commercial results. Poly Haven and ambientCG assets are CC0. CC0 has no attribution requirement, but source attribution is still included in the output.

## `maxResults` (type: `integer`):

Maximum number of normalized asset records to write to the dataset, from 1 to 200. Sources are interleaved fairly so one API cannot fill the whole result set. Pay-per-event charging occurs only for records actually written.

## `useMockData` (type: `boolean`):

Use cached API responses from `fixtures/mock_data.json` instead of making any network requests. Useful for offline demos, CI, and pay-per-event tests. License filtering, normalization, deduplication, dataset writes, and charging still run normally.

## Actor input object example

```json
{
  "query": "wooden chair",
  "sources": [
    "polyhaven",
    "ambientcg",
    "sketchfab"
  ],
  "assetType": "all",
  "preferredResolution": "1k",
  "commercialSafeOnly": true,
  "cc0Only": false,
  "maxResults": 20,
  "useMockData": false
}
```

# Actor output Schema

## `assets` (type: `string`):

One record per 3D model, PBR texture, or HDRI, normalized into the unified schema.

## `summary` (type: `string`):

Per-source status and counts, total returned and charged records, budget stop state, and attribution notices.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "wooden chair"
};

// Run the Actor and wait for it to finish
const run = await client.actor("jet_elation/unified-3d-pbr-asset-search").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "query": "wooden chair" }

# Run the Actor and wait for it to finish
run = client.actor("jet_elation/unified-3d-pbr-asset-search").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "wooden chair"
}' |
apify call jet_elation/unified-3d-pbr-asset-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jet_elation/unified-3d-pbr-asset-search"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/fVVXdQQGrxoYwGDpr/builds/73Mv4N0eWshFC8Zrq/openapi.json
