For developers

The API.

Read the catalogue and pull the files from a build step, a pipeline or an editor plugin. It is a read-only JSON API over HTTPS, and it downloads what your account can: everything with a subscription or during the free launch, otherwise the month's free models.

Authentication

Every request carries your key as a bearer token. Keys are shown once when created and stored only as a hash, so if you lose one, revoke it and make another. Keep it on a server: a key in browser JavaScript is a published key, which is why this API sends no CORS header.

curl -H "Authorization: Bearer $TJB_KEY" \
     https://www.threejsbank.com/api/v1/me

Endpoints

MethodPathWhat it returns
GET/api/v1/me Your account: its role, whether it is unlimited, and the free models left this month.
GET/api/v1/models The catalogue. Filters below.
GET/api/v1/models/{slug} One model, with its tags and collections.
GET/api/v1/models/{slug}/download The GLB itself. Counts against your allowance. Add ?colour= and a slug from the model's colours list to get that colourway; the atlas is baked in before the file is sent, so it arrives finished. An unknown slug returns the default rather than an error.
GET/api/v1/collections Every published collection that holds at least one model.
GET/api/v1/tags Every tag in use, with how many models carry it.

Filtering the catalogue

The same parameters the website uses, so a URL you built by clicking around the library translates straight across. Tags are ANDed: every one you name must be on the model.

ParameterMeaning
qFree text across titles, descriptions, tags and collection names.
tag[]A tag slug. Repeat it to narrow further.
collectionA collection slug.
categoryA category slug, e.g. food-drink. Every model also carries its category (or null).
limit1 to 100. Defaults to 24.
offsetWhere the page starts. Pair it with total.
# every low-poly building, two at a time
curl -H "Authorization: Bearer $TJB_KEY" \
     "https://www.threejsbank.com/api/v1/models?tag[]=building&tag[]=low-poly&limit=2"

# fetch one file
curl -H "Authorization: Bearer $TJB_KEY" -OJ \
     https://www.threejsbank.com/api/v1/models/airboat-bayou/download

Limits and errors

60 requests a minute per key. Over that you get 429 with a Retry-After header. Errors are always JSON with a stable code, so you can branch on it without reading the message.

StatusCodeMeaning
401unauthorizedMissing, wrong or revoked key.
402subscription_requiredThe month's free models are used. Subscribe for unlimited downloads.
404not_foundNo such model, or no such endpoint.
405method_not_allowedThe API is read-only.
429rate_limitedToo many requests, or the daily download cap.

Re-downloading a model you have already taken never costs a second slot, on the API exactly as on the site. A lost file or a repeated build must not burn your allowance.