This article contains best practices for interacting with and using the ZenVideo API.
In this article:
- Cache responses
- Using field filters
- Respecting rate limits
- Avoiding scraping
- Using only our publicly documented APIs
- Troubleshooting errors
Cache responses
Most metadata on ZenVideo doesn't change frequently (such as video names, descriptions, and embed code). Wherever possible, developers should cache these responses and serve them from the cache, making requests to the API only when new metadata is needed or expected. Implementing parameters such as the If-Modified-Since header can help in this area.
Read how at 'Using the If-Modified-Since header' on our Developer Page.
Use field filters
Many requests to ZenVideo will return a large amount of data, which may not be efficient if you only need a specific piece of information. Using the fields parameter to specify exactly what you need from the response will reduce the workload on our servers and increase the response time from the API. Using the fields parameter will also grant you a higher rate limit.
Read more about it in 'Using the fields parameter'.
Respect rate limits
We enforce rate limits to help ensure a stable platform for all developers. If your application exceeds the rate limit, the API will return an HTTP 429 error. Developers should anticipate this and cease making requests to the API until the rate limit ban has been lifted.
Read how at 'Working with rate limits'.
Avoid scraping
Scraping is the process of extracting data from a website, often by loading a webpage and executing a script to retrieve the desired data from the page.
Instead of scraping for data, developers should utilize one of our APIs to obtain the same data; implementing our API is easier and quicker than scraping the site.
If a server is found scraping ZenVideo and sending excessive traffic our way, that server’s IP address may be banned without notice. If you believe your server’s IP address has been banned, Contact Support with additional information.
Use only our publicly documented APIs
Developers may discover meta tags, config files, or other APIs used to get data from ZenVideo. However, we recommend that developers use only the public APIs documented on the Developer Site. These internal APIs are not intended for third-party use and may be modified or changed at any time without notice.
Troubleshooting errors
The ZenVideo Developer page provides information about the API that can help you troubleshoot errors that may occur when working with it.
For more information on industry-standard error codes, visit 'HTTP response status codes' on MDN Web Docs.
Comments
0 comments
Please sign in to leave a comment.