Data API v2 (deprecated)
WARNING: this section of the documentation discusses the v2 api endpoint which is deprecated.
Please use the v3 api endpoint instead.
Your application can interact with Sketchfab with a REST API accessible through https with a private API token. With the API, you can upload a 3D model to Sketchfab. Your API token is available in My Settings > Password.
If you're building an application, please read our Developer Guidelines.
Table of contents
Upload a model
You must perform an HTTP POST to https://api.sketchfab.com/v2/models
.
The uploaded file must be in one of the supported formats (or a compressed archive).
Parameters
The POST
request accepts the following parameters:
token
: your Sketchfab API tokenmodelFile
: the model you want to uploadname
(optional) : model namedescription
(optional) : model descriptiontags
(optional) : list of tags separated by spaceprivate
(optional) : if set to True, then the model is Private (requires a Pro account)password
(optional) : if private is set to True, you can add a password to protect your file (requires a Pro account)isPublished
(optional) : defaults to True; if set to False, the model will be uploaded in Draft Mode
We require the parameters to be posted separately as a multipart POST, not JSON or XML.
Response
The API will return:
201 {"uid": "xxxxxx"}
when the upload succeeds400 {"detail": a dict of error messages}
when there is an error
If the upload is successful, you model will be placed in the processing queue.
Your model will only be available for viewing when the processing is complete.
You can use the model uid
to poll for its processing status.
You can also use the returned uid
to embed a viewer showing the model.
See the oEmbed section.
Polling
Perform a HTTP GET to:
https://api.sketchfab.com/v2/models/{uid}/status?token={token}
The call will return the status as:
{'processing': processing code,
'error': 'an error message' (optional, will only be here if an error occurred)}
The processing code will be one of the following:
PENDING
: the model is in the processing queuePROCESSING
: the model is being processedSUCCEEDED
: the model has been successfully processed and can be displayedFAILED
: the processing has failed. An error message detailing the reason for the failure will be returned with the response