API Documentation: Integration

If you would like to integrate (i.e. embed) individual videos throughout your site (for example, on listing landing pages), the API is one way of doing that. Another way, which doesn't require using our API and is therefore easier, is to embed videos using the customid field, which is often used as a listing id. For more information on this, see Media Embedding.

That said, if you would like to utilize our API, the general flow is:

  1. Query for your videos.
  2. 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.
  3. Use the response fields to determine how you want to embed videos.
  4. 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.

Close