Wistia is a video hosting solution for marketers. We make it easy to upload, manage, share, and track your web video performance.
The Wistia data API gives you all kinds of programmatic access to your Wistia account. The data is available in either JSON or XML format over HTTP.
There is also a Wistia API Ruby gem for access from the command line.
Wistia API Exchange Forum: We've recently added a forum, just for Data API users. It's meant to be a place for sharing projects and getting language-specific help. Head to http://dev-forum.wistia.com to check it out!
Getting Started
Before delving into the specifics of using the API, there are some general concepts that you should be aware of:
Generate an API Password
Generate an API password for your account from the API area in your Account Dashboard.
Note: The user name is always api.

Authentication
You must use SSL (https instead of http) to access the API. The API uses HTTP Basic authentication to authorize access to the information.
JSON vs. XML
The request examples retrieve the data in JSON format.
If you would like the data in XML format,
change the extension of the request from json to xml.
PUT and DELETE
Some HTTP clients are limited to sending GET and POST requests
(e.g. HTML forms have this limitation).
You will notice, however, that many of the API calls only respond to
PUT or DELETE requests. In order to trigger these calls from a client that does not support
PUT or DELETE, use a POST request and add a parameter named “_method” (no quotes) with
a value of either put or delete.
Rate Limit
The API has a rate limit at 100 requests per minute. If there are more than 100 requests in a minute for a particular account, the service will respond with HTTP error 503 (Service Unavailable) and the Retry-After HTTP header will be set with a number of seconds to wait before trying again.
Versions and Updates
We will introduce API changes when necessary/possible, and update the version number (i.e. v1) when a breaking change is made.
Stay tuned to the dev-forum for updates on the API.
Resources
To make your Wistia experience even more awesome, here are some resources just for you:
Wistia-API Ruby Gem - selected best gem ever by Jim Bancroft
Wistia-API PHP Class - created by Stephen Reid
Projects
Projects are the main organizational objects within Wistia. Media must be stored within Projects.
Projects: List
Prerequisites
The username and password for your account.
The Request
In order to tell Wistia that you want a list of all projects, send the following request:
GET https://api.wistia.com/v1/projects.json
Sorting
You can get the results back sorted by the name, mediaCount, created, or updated fields.
In order to specify how you want the results to be sorted, append one or both of the following query parameters to the request
URL:
| Parameter | Description |
|---|---|
| sort_by | The name of the field to sort by. Valid values are “name”, “mediaCount”, “created”, or “updated”. Defaults to sorting by Project ID. |
| sort_direction | Specifies the direction of the sort, defaults to '1'. 1 = ascending, 0 = descending. |
For example, if you want to sort your results in descending order by the date each project was created, your request URL would look something like this:
https://api.wistia.com/v1/projects.json?sort_by=created&sort_direction=0
Paging
You can get your results back in chunks using the paging feature. In order to set the page size and/or the number of pages that you want to see, use the following query parameters:
| Parameter | Description |
|---|---|
| page | Specifies which page of the results you want to see. Defaults to 1 (not 0). |
| per_page | The number of results you want to get back per request. The maximum value of this parameter is 100. Defaults to 100. |
Example
If you want to get your results back 10 projects at a time, starting on the second page of results, then your request URL should look something like this:
https://api.wistia.com/v1/projects.json?page=2&per_page=10
The Response
Assuming authentication is successful and the request is in good order, the HTTP response will contain the list of all projects in your account. The format of the content (JSON or XML) depends on which extension was used to make the request.
| Field | Description |
|---|---|
| id | A unique numeric identifier for the project within the system. |
| name | The project's display name. |
| description | The project's description. |
| mediaCount | The number of different medias that have been uploaded to the project. |
| created | The date that the project was originally created. |
| updated | The date that the project was last updated. |
| hashedId | A private hashed id, uniquely identifying the project within the system. Used for playlists and RSS feeds. |
| anonymousCanUpload | A boolean indicating whether or not anonymous uploads are enabled for the project. |
| anonymousCanDownload | A boolean indicating whether or not anonymous downloads are enabled for this project. |
| public | A boolean indicating whether the project is available for public (anonymous) viewing. |
| publicId | If the project is public, this field contains a string representing the ID used for referencing the project in public URLs. |
Example JSON Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
Example XML Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
Projects: Show
The Wistia data API allows you to retrieve details about a specific project.
Prerequisites
The username and password for your account The ID of the project for which you want to retrieve media
The Request
In order to tell Wistia that you want a list of all the media for a specific project, send an HTTP GET request to the following URL:
GET https://api.wistia.com/v1/projects/
The Response
Assuming authentication is successful and the request is in good order, the HTTP response will contain detailed information about the requested project, including a list of the media in that project. The format of the content (JSON or XML) depends on which extension was used to make the request.
| Field | Description |
|---|---|
| id | A unique numeric identifier for the project within the system. |
| name | The project's title or display name. |
| description | The project's description. |
| mediaCount | The number of media in the project. |
| created | The date that the project was originally created. |
| updated | The date that the project was last changed. |
| hashedId | A private hashed id, uniquely identifying the project within the system. Used for playlists and RSS feeds. |
| anonymousCanUpload | A boolean indicating whether or not anonymous uploads are enabled for the project. |
| anonymousCanDownload | A boolean indicating whether or not anonymous downloads are enabled for this project. |
| public | A boolean indicating whether the project is available for public (anonymous) viewing. |
| publicId | If the project is public, this field contains a string representing the ID used for referencing the project in public URLs. |
| medias | An array containing a list of objects representing the media in the project. See the table below for a description of the fields in each media entry. |
Each entry in the media array for a project has the following fields:
| Field | Description |
|---|---|
| id | A unique numeric identifier for the media within the system. |
| name | The display name of the media. |
| section (optional) | The title of the section in which the media appears. This attribute is omitted if the media is not in a section (default). |
| thumbnail | An object representing the thumbnail for this media. The attributes are URL, width, and height. |
| type | A string representing what type of media this is. Valid values are “Video”, “Image”, “Audio”, “Swf”, “MicrosoftOfficeDocument”, “PdfDocument”, or “UnknownType”. |
| duration (optional) | For Audio or Video files, this field specifies the length (in seconds). For Document files, this field specifies the number of pages in the document. For other types of media, or if the duration is unknown, this field is omitted. |
| created | The date when the media was originally uploaded. |
| updated | The date when the media was last changed. |
Example JSON Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
Example XML Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
Projects: Create
Using the API, you can create a new project in your account.
The Request
POST https://api.wistia.com/v1/projects.json
Parameters
The only required parameter is the name of the project that you want to create. You can also set the project administrator by passing an extra parameter specifying their email. The following table lists the valid parameters for this action:
| Parameter Name | Description |
|---|---|
| name | The name of the project you want to create. |
| adminEmail (optional) | The email address of the person you want to set as the owner of this project. If this parameter is not present or if it specifies a user that is not an account manager, the project admin will default to the Wistia account owner. |
| anonymousCanUpload (optional) | A flag indicating whether or not anonymous users may upload files to this project. Set to “1” to enable and “0” to disable. |
| anonymousCanDownload (optional) | A flag indicating whether or not anonymous users may download files from this project. Set to “1” to enable and “0” to disable. |
| public (optional) | A flag indicating whether or not the project is enabled for public access. Set to “1” to enable and “0” to disable. |
The parameters should be passed in the body of the request and URL encoded. Alternatively, they can be appended to the end of the URL after a question mark (?) character and passed as query string parameters.
The Response
If the project is created successfully, the API will respond with an “HTTP 201 Created” status code, and the “Location” HTTP header will refer to the URL where the API can make the next request to get the new project. The body of the response will contain the newly created project in XML or JSON format, depending on which extension was used in the request.
| Field | Description |
|---|---|
| id | A numeric identifier that uniquely identifies the project to the system. You can use this field to obtain more information about the project using the other API methods. |
| name | The name of the newly created project. |
| description | The description of the newly created project. |
| mediaCount | The number of media in the project. |
| created | The date that the project was originally created. |
| updated | The date that the project was last changed. |
| hashedId | A private hashed id, uniquely identifying the project within the system. Used for playlists and RSS feeds. |
| anonymousCanUpload | A boolean indicating whether or not anonymous uploads are enabled for the project. |
| anonymousCanDownload | A boolean indicating whether or not anonymous downloads are enabled for this project. |
| public | A boolean indicating whether the project is available for public (anonymous) viewing. |
| publicId | If the project is public, this field contains a string representing the ID used for referencing the project in public URLs. |
Example JSON Response
Status: 201 Created
Location: https://api.wistia.com/v1/projects/1.json
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Example XML Response
Status: 201 Created
Location: https://api.wistia.com/v1/projects/1.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Projects: Update
The Wistia data API allows you to update a project. Currently, the only attribute that you can update is the project name.
The Request
PUT https://api.wistia.com/v1/projects/
Make sure you replace <project-id> with the hashed ID of the project that you want to update.
The Parameters
Here are the valid parameters for this action:
| Parameter Name | Description |
|---|---|
| name | The project's new name. |
| anonymousCanUpload | A flag indicating whether or not anonymous users may upload files to this project. Set to “1” to enable and “0” to disable. |
| anonymousCanDownload | A flag indicating whether or not anonymous users may download files from this project. Set to “1” to enable and “0” to disable. |
| public | A flag indicating whether or not the project is enabled for public access. Set to “1” to enable and “0” to disable. |
The Response
If the project update is successful, the server will send a response with something similar to the following:
| Field | Description |
|---|---|
| id | A numeric identifier that uniquely identifies the project to the system. You can use this field to obtain more information about the project using the other API methods. |
| name | The name of the project. |
| description | A description of the project. |
| mediaCount | The number of media in the project. |
| created | The date that the project was originally created. |
| updated | The date that the project was last changed. |
| hashedId | A private hashed id, uniquely identifying the project within the system. Used for playlists and RSS feeds. |
| anonymousCanUpload | A boolean indicating whether or not anonymous uploads are enabled for the project. |
| anonymousCanDownload | A boolean indicating whether or not anonymous downloads are enabled for this project. |
| public | A boolean indicating whether the project is available for public (anonymous) viewing. |
| publicId | If the project is public, this field contains a string representing the ID used for referencing the project in public URLs. |
Example JSON Response
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Example XML Response
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Projects: Delete
The Wistia data API allows you to delete a project.
The Request
DELETE https://api.wistia.com/v1/projects/
Make sure you replace
The Parameters
This action does not take any parameters.
The Response
If the project is deleted successfully, the server will respond with HTTP status 200 OK to let you know that it worked. The body of the response will contain an object representing the project that was just deleted.
| Field | Description |
|---|---|
| id | A numeric identifier that uniquely identifies the project to the system. You can use this field to obtain more information about the project using the other API methods. |
| name | The name of the project. |
| description | A description of the project. |
| mediaCount | The number of media in the project. |
| created | The date that the project was originally created. |
| updated | The date that the project was last changed. |
| hashedId | A private hashed id, uniquely identifying the project within the system. Used for playlists and RSS feeds. |
| anonymousCanUpload | A boolean indicating whether or not anonymous uploads are enabled for the project. |
| anonymousCanDownload | A boolean indicating whether or not anonymous downloads are enabled for this project. |
| public | A boolean indicating whether the project is available for public (anonymous) viewing. |
| publicId | If the project is public, this field contains a string representing the ID used for referencing the project in public URLs. |
Example JSON Response
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Example XML Response
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Projects: Copy
The Wistia data API allows you to copy a project, including all of its media, sidebar elements, and sections.
Note
This method does not copy the projects sharing information (i.e. users that could see the old project will not automatically be able to see the new one).
The Request
POST https://api.wistia.com/v1/projects/
Make sure you replace <project-id> with the hashed ID of the project that you want to copy.
Parameters
You can specify the owner of the new project by passing an optional parameter.
The person you specify must be a manager in the account. If you omit this
parameter, or if you specify an email address for someone that's not a manager,
the project owner defaults to the account owner.
| Parameter Name | Description |
|---|---|
| adminEmail (optional) | The email address of the account manager that will be the owner of the new project. Defaults to the account owner if invalid or omitted. |
The Response
If the project is copied successfully, the server will respond with HTTP status 201 Created to let you know that it worked.
The HTTP Location header will be set to the URL where the newly created project resource resides. The body of the response will contain an object representing the new copy of the project that was just created.
| Field | Description |
|---|---|
| id | A numeric identifier that uniquely identifies the project to the system. You can use this field to obtain more information about the project using the other API methods. |
| name | The name of the project. |
| description | A description of the project. |
| mediaCount | The number of media in the project. |
| created | The date that the project was originally created. |
| updated | The date that the project was last changed. |
| hashedId | A private hashed id, uniquely identifying the project within the system. Used for playlists and RSS feeds. |
| anonymousCanUpload | A boolean indicating whether or not anonymous uploads are enabled for the project. |
| anonymousCanDownload | A boolean indicating whether or not anonymous downloads are enabled for this project. |
| public | A boolean indicating whether the project is available for public (anonymous) viewing. |
| publicId | If the project is public, this field contains a string representing the ID used for referencing the project in public URLs. |
Example JSON Response
Status: 201 Created
Location: https://api.wistia.com/v1/projects/3.json
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Example XML Response
Status: 201 Created
Location: https://api.wistia.com/v1/projects/3.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Project Sharings
A sharing is an object that links either a contact or a contact group to a project, including information about the contacts' permissions to that project.
Project Sharings: List
The Wistia data API allows you to see a list of sharings on a project. A sharing is an object that links either a contact or a contact group to a project, including information about the contacts#039; permissions to that project.
The Request
GET https://api.wistia.com/v1/projects/
Make sure you replace <project-id> with the hashed ID of the project for which you would like to see sharings.
The Parameters
This method does not accept any other parameters.
The Response
The server responds with HTTP status 200 OK and the response body contains a list of all the sharings on the project.
| Field | Description |
|---|---|
| id | A unique numeric identifier for the sharing object within the system. |
| isAdmin | This field indicates whether the user has admin rights on the project. |
| canShare | This field indicates whether the user is allowed to share the project with others. |
| canDownload | This field indicates whether the user is allowed to download files from the project. |
| canUpload | This field indicates whether the user is allowed to upload files to the project. |
| share | An object identifying the Contact or ContactGroup with which this sharing object ties the project. See below for a description of the fields in this object. |
| project | An object representing the project to which this sharing object grants access. It only has 2 attributes: id and name, which both have the same meaning as they do elsewhere in the API. |
The attributes of each share object are as follows:
| Field | Description |
|---|---|
| id | A unique numeric identifier for the Contact or ContactGroup. |
| name | The display name of this Contact or ContactGroup. |
| type | A string representing what type of share this object represents: 'Contact' or 'ContactGroup'. |
| email (if available) |
If this object refers to a Contact, this field will be present, indicating the contact email of the person with which the project is shared. If it's a ContactGroup, this field will be omitted. |
Example JSON Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
Example XML Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
Project Sharings: Show
The Wistia data API allows you to see the details of a particular sharing on a project.
The Request
GET https://api.wistia.com/v1/projects/
Make sure you replace <project-id> with the hashed ID of the project for
which you would like to see sharings, and replace
The Paramters
This method does not accept any other parameters.
The Response
The server responds with HTTP status 200 OK and the response body contains the requested sharing on the project.
| Field | Description |
|---|---|
| id | A unique numeric identifier for the sharing object within the system. |
| isAdmin | This field indicates whether the user has admin rights on the project. |
| canShare | This field indicates whether the user is allowed to share the project with others. |
| canDownload | This field indicates whether the user is allowed to download files from the project. |
| canUpload | This field indicates whether the user is allowed to upload files to the project. |
| share | An object identifying the Contact or ContactGroup with which this sharing object ties the project. See below for a description of the fields in this object. |
| project | An object representing the project to which this sharing object grants access. It only has 2 attributes: id and name, which both have the same meaning as they do elsewhere in the API. |
The attributes of each share object are as follows:
| Field | Description |
|---|---|
| id | A unique numeric identifier for the Contact or ContactGroup. |
| name | The display name of this Contact or ContactGroup. |
| type | A string representing what type of share this object represents: 'Contact' or 'ContactGroup'. |
| email (if available) |
If this object refers to a Contact, this field will be present, indicating the contact email of the person with which the project is shared. If it's a ContactGroup, this field will be omitted. |
Example JSON Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Example XML Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Project Sharings: Create
The Wistia data API allows you to share a project with a user by email. Conceptually, you do this by creating a new sharing object for a project.
The Request
POST https://api.wistia.com/v1/projects/
Make sure you replace <project-id> with the hashed ID of the project that
you want to share.
This method can accept several parameters to customize the way that the sharing happens.
The only required parameter is with, which specifies the email address of the person with whom you want to share the project.
| Parameter | Description |
|---|---|
| with | The email address of the person with whom you want to share the project. |
| requirePassword (optional) | If this parameter is “1” (no quotes), which is the default value, then the user will be required to activate their account and set a password to see the project. Set it to “0” (again, no quotes) to allow them to see the project without entering a password. |
| canShare (optional) | Set this parameter to “1” (no quotes) to allow the user to share the project with others. |
| canDownload (optional) | Set this parameter to “1” (no quotes) to allow the user to download files from the project. |
| canUpload (optional) | Set this parameter to “1” (no quotes) to allow the user to upload files to the project. |
The Response
If the operation completes successfully, the user will have access to the specified project. The server responds with HTTP status 201 Created, and the Location HTTP header is set to the place where more information about the new sharing object can be found through the API. The response body contains either a link for the user to activate their account or a link for the user to access the project if they already have a username/password.
Example JSON Response
Status: 201 Created
Location: https://api.wistia.com/v1/projects/13/sharings/16.json
1
| |
Here's an example of what the response body might look like if the user is not yet activated:
1
| |
Example XML Response
Status: 201 Created
Location: https://api.wistia.com/v1/projects/13/sharings/16.xml
1 2 3 | |
Here's an example of what the response body might look like if the user is not yet activated:
1 2 3 | |
Project Sharings: Update the Sharing on a Project
The Wistia data API allows you to update a sharing on a project. Currently, the only attributes that you can update are can_share, can_download, can_upload, and is_admin.
The Request
PUT https://api.wistia.com/v1/projects/
Make sure you replace <project-id> with the hashed ID of the project that you want,
and replace <sharing-id> with the ID of the sharing that you want to update.
| Parameter Name | Description |
|---|---|
| canShare (optional) | “1” to allow the user or group to share the project with others, “0” to disable this functionality. |
| canDownload (optional) | “1” to allow the user or group to download media from the project, “0” to disable this functionality. |
| canUpload (optional) | “1” to allow the user or group to upload media to the project, “0” to disable this functionality. |
| isAdmin (optional) | “1” to give this user admin rights to the project, “0” to take away admin rights. |
Notice that every parameter for this action is optional. Omitting a parameter from the request will leave that attribute alone.
The Response
If the update is successful, the server will send a response with something similar to the following:
| Field | Description |
|---|---|
| id | A unique numeric identifier for the sharing object within the system. |
| isAdmin | This field indicates whether the user has admin rights on the project. |
| canShare | This field indicates whether the user is allowed to share the project with others. |
| canDownload | This field indicates whether the user is allowed to download files from the project. |
| canUpload | This field indicates whether the user is allowed to upload files to the project. |
| share | An object identifying the Contact or ContactGroup with which this sharing object ties the project. See below for a description of the fields in this object. |
| project | An object representing the project to which this sharing object grants access. It only has 2 attributes: id and name, which both have the same meaning as they do elsewhere in the API. |
The attributes of each share object are as follows:
| Field | Description |
|---|---|
| id | A unique numeric identifier for the Contact or ContactGroup. |
| name | The display name of this Contact or ContactGroup. |
| type | A string representing what type of share this object represents: 'Contact' or 'ContactGroup'. |
| email (if available) |
If this object refers to a Contact, this field will be present, indicating the contact email of the person with which the project is shared. If it's a ContactGroup, this field will be omitted. |
Example JSON Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Example XML Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Errors
While we know your code is literally flawless, late nights and too much Jolt can cause errors.
If the request would cause the system to get into an invalid or inconsistent state, the update operation will fail. Errors will look like the following:
Example JSON Error Response
Status: 400 Bad Request
1 2 3 | |
Example XML Error Response
Status: 400 Bad Request
1 2 3 4 | |
Project Sharings: Delete
The Wistia data API allows you to delete a sharing on a project.
Request
DELETE https://api.wistia.com/v1/projects/
Make sure you replace <project-id> with the hashed ID of
the project that you want, and replace <sharing-id> with the
ID of the sharing you want to delete.
Parameters
This action does not take any parameters.
Response
If the sharing is deleted successfully, the server will respond with HTTP status 200 OK to let you know that it worked. The body of the response will contain an object representing the sharing that was just deleted.
| Field | Description |
|---|---|
| id | A unique numeric identifier for the sharing object within the system. |
| isAdmin | This field indicates whether the user has admin rights on the project. |
| canShare | This field indicates whether the user is allowed to share the project with others. |
| canDownload | This field indicates whether the user is allowed to download files from the project. |
| canUpload | This field indicates whether the user is allowed to upload files to the project. |
| share | An object identifying the Contact or ContactGroup with which this sharing object ties the project. See below for a description of the fields in this object. |
| project | An object representing the project to which this sharing object grants access. It only has 2 attributes: id and name, which both have the same meaning as they do elsewhere in the API. |
The attributes of each share object are as follows:
| Field | Description |
|---|---|
| id | A unique numeric identifier for the Contact or ContactGroup. |
| name | The display name of this Contact or ContactGroup. |
| type | A string representing what type of share this object represents: 'Contact' or 'ContactGroup'. |
| email (if available) |
If this object refers to a Contact, this field will be present, indicating the contact email of the person with which the project is shared. If it's a ContactGroup, this field will be omitted. |
Example JSON Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Example XML Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Medias
Medias: List
Using the Wistia data API, you can obtain a list of all the media in your account.
Request
The format of the request should be something like this:
https://api.wistia.com/v1/medias.json
Parameters
Sorting
You can get the results back sorted by the name, created, or
updated fields. In order to specify how you want the results to be sorted, append one or both of the
following query parameters to the request URL:
| Parameter | Description |
|---|---|
| sort_by | The name of the field to sort by. Valid values are name, created, or updated. Any other value will cause the results to be sorted by id, which is the default. |
| sort_direction (optional, defaults to 1) | This field specifies the direction of the sort. Valid values are 1 or 0, which specify ascending or descending order, respectively. |
For example, if you want to sort your results in descending order by the date each media was created (i.e. when it was first uploaded to Wistia), your request URL would look something like this:
https://api.wistia.com/v1/medias.json?sort_by=created&sort_direction=0
Paging
You can get your results back in chunks using the paging feature. In order to set the page size and/or the number of pages that you want to see, use the following query parameters:
| Parameter | Description |
|---|---|
| page (optional, defaults to 1) | Specifies which page of the results you want to see. Note that this parameter starts at 1, as opposed to 0. |
| per_page (optional, defaults to 100) | This parameter lets you set how many results you want to get back in each request. In order to mitigate long-running requests to the API, the maximum value of this parameter is 100. |
For example, if you want to get your results back 10 media at a time, starting on the second page of results, then your request URL should look something like this:
https://api.wistia.com/v1/medias.json?page=2&per_page=10
Filtering
You can filter the results by project or type of media. Similar to sorting, filters are specified by appending query parameters to the end of the URL used to access the API. The following table lists the parameters that you can use for filtering and a description of how to use them.
| Parameter | Description |
|---|---|
| project_id | An integer specifying the project from which you would like to get results. |
| name | Find a media or medias whose name exactly matches this parameter. |
| type | A string specifying which type of media you would like to get. The valid values are “Video”, “Audio”, “Image”, “PdfDocument”, “MicrosoftOfficeDocument”, “Swf”, or “UnknownType”. |
| hashed_id | Find the media by hashed_id, which is now present in Wistia embeds. |
The Response
Assuming authentication is successful and the request is in good order, the HTTP response will contain a list of all media for the account.
| Field | Description |
|---|---|
| id | A unique numeric identifier for the media within the system. |
| name | The display name of the media. |
| project | An object representing information about the project in which the media resides. It has 2 fields: the numeric id of the project, and the name of the project. |
| type | A string representing what type of media this is. Valid values are “Video”, “Image”, “Audio”, “Swf”, “MicrosoftOfficeDocument”, “PdfDocument”, or “UnknownType”. |
| status | After a file has been uploaded to Wistia, it needs to be processed before it's available for online viewing. There are four statuses: "queued", "processing", "ready", and "failed". Queued means the file is waiting in the queue to be processed. Processing means the file is actively being processed. Ready means it has been fully processed and is ready for embedding and viewing. Failed means that we were unable to automatically process the file. |
| progress (if available) |
This field is a floating point value between 0 and 1 that indicates the progress of the processing for this file. For instance, a value of 0.5 indicates we're about halfway done processing this file. |
| section (if available) |
The title of the section in which the media appears. This attribute is omitted if the media is not in a section (default). |
| thumbnail | An object representing the thumbnail for this media. The attributes are URL, width, and height. |
| duration (if available) |
For Audio or Video files, this field specifies the length (in seconds). For Document files, this field specifies the number of pages in the document. For other types of media, or if the duration is unknown, this field is omitted. |
| created | The date when the media was originally uploaded. |
| updated | The date when the media was last changed. |
| assets | An array of the assets available for this media. See the table below for a description the fields in each asset object. |
| embedCode | DEPRECATED: If you want to programmatically embed videos, use the Embedding API. |
| description | A description for the media which usually appears near the top of the sidebar on the media's page. |
| hashed_id | A unique alphanumeric identifier for this media. It's used all over the place, from URLs inside the Wistia application (e.g. http://home.wistia.com/medias/jocs98za4l) to embed codes! |
Each asset object in the assets array has the following properties:
| Field | Description |
|---|---|
| url | A direct-access URL to the content of the asset. |
| width (if available) |
The width of this specific asset, if applicable. |
| height (if available) |
The height of this specific asset, if applicable. |
| fileSize | The size of the asset file that's referenced by url, measured in bytes. |
| contentType | The asset's content type. |
| type | The internal type of the asset, describing how the asset should be used. Valid values are “OriginalFile”, “FlashVideoFile”, “Mp4VideoFile”, “IPhoneVideoFile”, “StillImageFile”, “SwfFile”, “Mp3AudioFile”, and “LargeImageFile”. |
Example JSON Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
Example XML Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | |
Media: Show
The Wistia data API allows you to get information about a specific piece of media that you have uploaded to your account.
Prerequisites/Required Info
- Your user ID and password.
- The ID of the specific piece of media that you want to retrieve.
Request
In order to tell Wistia that you want information about a specific piece of media, send an HTTP GET request to the following URL:
https://api.wistia.com/v1/medias/
Make sure you replace <media-id> with the hashed ID of the media that you want.
Response
Assuming authentication is successful and the request is in good order, the HTTP response will contain detailed information about the requested media. The format of the content (JSON or XML) depends on which extension was used to make the request.
| Field | Description |
|---|---|
| id | A unique numeric identifier for the media within the system. |
| name | The display name of the media. |
| type | A string representing what type of media this is. Valid values are “Video”, “Image”, “Audio”, “Swf”, “MicrosoftOfficeDocument”, “PdfDocument”, or “UnknownType”. |
| section (if available) |
The title of the section in which the media appears. This attribute is omitted if the media is not in a section (default). |
| status | After a file has been uploaded to Wistia, it needs to be processed before it's available for online viewing. There are four statuses: "queued", "processing", "ready", and "failed". Queued means the file is waiting in the queue to be processed. Processing means the file is actively being processed. Ready means it has been fully processed and is ready for embedding and viewing. Failed means that we were unable to automatically process the file. |
| progress (if available) |
This field is a floating point value between 0 and 1 that indicates the progress of the processing for this file. For instance, a value of 0.5 indicates we're about halfway done processing this file. |
| thumbnail | An object representing the thumbnail for this media. The attributes are URL, width, and height. |
| duration (if available) |
For Audio or Video files, this field specifies the length (in seconds). For Document files, this field specifies the number of pages in the document. For other types of media, or if the duration is unknown, this field is omitted. |
| created | The date when the media was originally uploaded. |
| updated | The date when the media was last changed. |
| assets | An array of the assets available for this media. See the table below for a description the fields in each asset object. |
| embedCode | DEPRECATED: If you want to programmatically embed videos, use the Embedding API. |
| description | A description for the media which usually appears near the top of the sidebar on the media's page. |
| hashed_id | A unique alphanumeric identifier for this media. It's used all over the place, from URLs inside the Wistia application (e.g. http://home.wistia.com/medias/jocs98za4l) to embed codes! |
Each asset object in the assets array has the following properties:
| Field | Description |
|---|---|
| url | A direct-access URL to the content of the asset. These URLs end in a .bin extension (for binary). |
| width (optional) | The width of this specific asset, if applicable. |
| height (optional) | The height of this specific asset, if applicable. |
| fileSize | The size of the asset file that's referenced by url, measured in bytes. |
| contentType | The asset's content type. |
| type | The internal type of the asset, describing how the asset should be used. Valid values are “OriginalFile”, “FlashVideoFile”, “Mp4VideoFile”, “IPhoneVideoFile”, “StillImageFile”, “SwfFile”, “Mp3AudioFile”, and “LargeImageFile”. |
Example JSON Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
Example XML Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
Media: Update
The Wistia data API allows you to update a piece of media.
The Request
PUT https://api.wistia.com/v1/medias/
Make sure you replace <media-id> with the hashed ID of the media that you want to update.
| Parameter Name | Description |
|---|---|
| name | The media's new name. |
| new_still_media_id | The numeric ID of an image within the system that will replace the still that's displayed before the player starts playing. If this parameter is present while updating a non-video media, or if it specifies a non-image type media, then the call will fail with an error. |
| description | A new description to display next to the media within Wistia. |
The Response
If the media update is successful, the server will send a response with the following fields:
| Field | Description |
|---|---|
| id | A unique numeric identifier for the media within the system. |
| name | The display name of the media. |
| type | A string representing what type of media this is. Valid values are “Video”, “Image”, “Audio”, “Swf”, “MicrosoftOfficeDocument”, “PdfDocument”, or “UnknownType”. |
| section (if available) |
The title of the section in which the media appears. This attribute is omitted if the media is not in a section (default). |
| status | After a file has been uploaded to Wistia, it needs to be processed before it's available for online viewing. There are four statuses: "queued", "processing", "ready", and "failed". Queued means the file is waiting in the queue to be processed. Processing means the file is actively being processed. Ready means it has been fully processed and is ready for embedding and viewing. Failed means that we were unable to automatically process the file. |
| progress (if available) |
This field is a floating point value between 0 and 1 that indicates the progress of the processing for this file. For instance, a value of 0.5 indicates we're about halfway done processing this file. |
| thumbnail | An object representing the thumbnail for this media. The attributes are url, width, and height. |
| duration (if available) |
For Audio or Video files, this field specifies the length (in seconds). For Document files, this field specifies the number of pages in the document. For other types of media, or if the duration is unknown, this field is omitted. |
| created | The date when the media was originally uploaded. |
| updated | The date when the media was last changed. |
Example JSON Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
Example XML Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
Media: Delete
The Wistia data API allows you to delete a piece of media.
The Request
DELETE https://api.wistia.com/v1/medias/
Make sure you replace <media-id> with the hashed ID of the media that you want
to delete. This action does not take any parameters.
The Response
If the media is deleted successfully, the server will respond with HTTP status 200 OK to let you know that it worked. The body of the response will contain an object representing the piece of media that was just deleted.
| Field | Description |
|---|---|
| id | A unique numeric identifier for the media within the system. |
| name | The display name of the media. |
| type | A string representing what type of media this is. Valid values are “Video”, “Image”, “Audio”, “Swf”, “MicrosoftOfficeDocument”, “PdfDocument”, or “UnknownType”. |
| section (if available) |
The title of the section in which the media appears. This attribute is omitted if the media is not in a section (default). |
| status | After a file has been uploaded to Wistia, it needs to be processed before it's available for online viewing. There are four statuses: "queued", "processing", "ready", and "failed". Queued means the file is waiting in the queue to be processed. Processing means the file is actively being processed. Ready means it has been fully processed and is ready for embedding and viewing. Failed means that we were unable to automatically process the file. |
| progress (if available) |
This field is a floating point value between 0 and 1 that indicates the progress of the processing for this file. For instance, a value of 0.5 indicates we're about halfway done processing this file. |
| thumbnail | An object representing the thumbnail for this media. The attributes are url, width, and height. |
| duration (if available) |
For Audio or Video files, this field specifies the length (in seconds). For Document files, this field specifies the number of pages in the document. For other types of media, or if the duration is unknown, this field is omitted. |
| created | The date when the media was originally uploaded. |
| updated | The date when the media was last changed. |
Example JSON Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
Example XML Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
Media: Copy
The Wistia data API allows you to copy a piece of media.
The Request
POST https://api.wistia.com/v1/medias/
Make sure you replace <media-id> with the hashed ID of the media that you want to copy.
Parameters
| Parameter | Description |
|---|---|
| project_id (optional) | The ID of the project where you want the new copy placed. If this value is invalid or omitted, defaults to the source media's current project. |
| owner (optional) | An email address specifying the owner of the new media. If this value is invalid or omitted, defaults to the source media's current owner. |
The Response
If the media is copied successfully, the server will respond with HTTP status 201 Created to let you know that it worked. The HTTP Location header will be set to the URL where the newly created media resource resides. The body of the response will contain an object representing the new copy of the media that was just created.
| Field | Description |
|---|---|
| id | A unique numeric identifier for the media within the system. |
| name | The display name of the media. |
| type | A string representing what type of media this is. Valid values are “Video”, “Image”, “Audio”, “Swf”, “MicrosoftOfficeDocument”, “PdfDocument”, or “UnknownType”. |
| section (if available) |
The title of the section in which the media appears. This attribute is omitted if the media is not in a section (default). |
| status | After a file has been uploaded to Wistia, it needs to be processed before it's available for online viewing. There are four statuses: "queued", "processing", "ready", and "failed". Queued means the file is waiting in the queue to be processed. Processing means the file is actively being processed. Ready means it has been fully processed and is ready for embedding and viewing. Failed means that we were unable to automatically process the file. |
| progress (if available) |
This field is a floating point value between 0 and 1 that indicates the progress of the processing for this file. For instance, a value of 0.5 indicates we're about halfway done processing this file. |
| thumbnail | An object representing the thumbnail for this media. The attributes are url, width, and height. |
| duration (if available) |
For Audio or Video files, this field specifies the length (in seconds). For Document files, this field specifies the number of pages in the document. For other types of media, or if the duration is unknown, this field is omitted. |
| created | The date when the media was originally uploaded. |
| updated | The date when the media was last changed. |
Example JSON Response
Status: 201 Created
Location: https://api.wistia.com/v1/medias/3.json
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
Example XML Response
Status: 201 Created
Location: https://api.wistia.com/v1/medias/3.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
Media: Show Stats
The Wistia data API allows you to get the aggregated tracking statistics for a video that has been embedded on your site.
Note: This request works for videos only.
If you try to get stats for a piece of media that is not a video, the server will respond with HTTP status code “400 Bad Request” and the body will contain an error message (in either XML or JSON format).
The Request
GET https://api.wistia.com/v1/medias/
Make sure you replace
The Response
If the request is successful, the server will send a response with something similar to the following:
| Field | Description |
|---|---|
| id | A unique numeric identifier for the video within the system. |
| name | The display name of the video. |
| stats | An object representing the aggregated embed statistics for this video. See the next table for a description of what each attribute means. |
Here is the definition of each field in the stats object:
| Field | Description |
|---|---|
| pageLoads | The total number of times that the page containing the embedded video has been loaded. |
| visitors | The number of unique visitors to the page containing the embedded video. |
| percentOfVisitorsClickingPlay | This is an integer between 0 and 100 that shows what percentage of the time someone who saw the page containing the embedded video played the video. |
| plays | The total number of times that the video has been played. |
| averagePercentWatched | This is an integer between 0 and 100. It shows the average percentage of the video that was watched over every time the video was played. For example, if you embed a video on a page and then load that page and watch the video all the way through, the value of this field will be 100. If you or someone else then loads the page but only watches half (50%) of the video, then the value of this field will drop to 75. |
Example JSON Response
1 2 3 4 5 6 7 8 9 10 11 | |
Example XML Response
1 2 3 4 5 6 7 8 9 10 11 | |
Account API
The Request
GET https://api.wistia.com/v1/account.json
The Response
| Field | Description |
|---|---|
| Id | Numeric id of the account |
| Name | Account name |
| Url | Account's main Wistia URL |
Asset URLs - Tips & Tricks
Modifying File Extensions
Asset URLs in Wistia take this form:
http://embed.wistia.com/deliveries/43500c9644e43068d8995dcb5ddea82440419eaf.bin
The .bin extension at the URL is for binary. Certain ornery clients (iTunes, ahem) won't accept URLs that don't end in an extension that's familiar to them. In this case, you can drop the .bin, add a slash, and append whatever filename and extension you like – you'll still get the underlying asset. So, say the URL above is an mp4 file and we really want that in the URL. Here's what we'd have:
http://embed.wistia.com/deliveries/43500c9644e43068d8995dcb5ddea82440419eaf/my-file.mp4
Resizing Images
Using the Data API or oEmbed endpoint, you can obtain the thumbnail URL for your video, and then manipulate it. Check working with images