API REST Method: thumbnail

Get the known video thumbnail by its source url (url), source embed code (embed), Magma video id (id), or Magma instance id (instance_id).

(Note: The info method can return information for an instance or a video. To learn more about how we categorize videos and instances, please read this page.)

 

URL
    http://mag.ma/thumbnail.format

Formats
    XML, JSON, YAML, HTML, JS, text, GIF, JPEG, PNG

Note: If GIF, JPEG, or PNG content type are requested, Magma will send redirect headers to the appropriate location for the image. All other methods will return the image URL.

HTTP Method
    GET

Authentication
    none

Rate Limited
    none

Parameters
    (* Either id, url, embed, or instance_id must be specified.)

  • id. Required* : Magma video identification number.
  • url. Required* : Video source URL.
  • embed. Required* : Video source embed code.
  • instance_id. Required* : Magma instance identification number.
    • This number is the id given inside the <instance> block. When instance_id is specified, information will always be returned as information for that single instance and not the Magma video.
    • Example: http://vimeo.com/9749744
  • callback. Optional. Specify a function callback (JSON format only)

Response

Note: If GIF, JPEG, or PNG content type are requested, Magma will send redirect headers to the appropriate location for the image. All other methods will return the image URL. If a video cannot be found, GIF, JPEG, and PNG requests will return a generic default image icon, otherwise a HTTP status code 404 will be returned

   JSON Example:

              { "thumbnail": "http://ts.vimeo.com.s3.amazonaws.com/492/116/49211644_200.jpg" }
              

Example Usage

    cURL request using Magma video id:
        curl http://mag.ma/thumbnail.json?id=420278 

    cURL request using Magma instance id:
        curl http://mag.ma/thumbnail.json?instance_id=439007 

    cURL request using video URL:
        curl http://mag.ma/thumbnail.json?url=http://vimeo.com/9749744 

    cURL request using video embed code:
        curl http://mag.ma/thumbnail.json?embed=%3Cobject%3E...%3C%2Fobject%3E 

 

Return to API Documentation