API Documentation: Integration
That said, if you would like to utilize our API, the general flow is:
- Query for your videos.
- Store the results in your database on a schedule (updating as often as needed via cronjob, etc.) Only the hash field is needed for embedding. Calling our API each time a page is loaded is not advised and will soon be rate-limited. Furthermore, since the unique part of our embed code is the hash, and the hash never changes, re-querying adds an unnecessary lookup delay to your site.
- Use the response fields to determine how you want to embed videos.
- Embed videos throughout your site Ideally, this is done programmatically rather than manually embedding each video.
Looking at the Response, there are a number of fields you can use for #3 (determining which videos to embed):
- Slideshow: Whether a video is a slideshow or a full-motion video.
- Keywords: These are optional tags associated with each video.
- Custom ID: This is an optional and (ideally) unique ID for this video that you can specify. For properties, a listing ID is often used for this.
- Video Type: This is the type of video field that is required when uploading a video.
These are the fields typically used for integrating videos, but it's really whatever makes the most sense for you. For example, if you had more than one video for a given customid, you could choose the one with the newest timestamp. Once you know a video's hash, you can find instructions for embedding here.