giflayer API

The giflayer API was built to provide a powerful and simple way to perform Video to GIF Conversion at an unparalleled speed and a quality of up to 30 FPS (Frames per Second), supporting all major video portals (e.g. YouTube, Vimeo, Vine, ... ), direct video links and video file formats.

Integrating our GIF conversion engine into your application will enable you to automatically generate GIFs with a full-featured suite of customization options at your disposal. These include Cropping, Resizing, creating Trailers, setting Start, End and Duration parameters, specifying your preferred FPS, and more.

API Requests are made using an easy-to-use URL structure, GIFs are delivered within a matter of seconds, and all API messages and notifications are returned in handy and lightweight JSON format. The following API documentation intends to provide interactive usage guides, detailed descriptions, and code examples for different programming languages.

Specs & Overview

API Access Key & Authentication

After signing up, every user is assigned a personal API Access Key - a unique "password" used to make requests to the API.

To authenticate with the numverify API, simply attach your access_key to the base endpoint URL:

After executing this API request, the giflayer API will return your GIF within seconds. However, there are many more optional parameters that can be used to customize the end product. Find some of them below:

Optional parameters:

duration paired with either "start" or end" it provides Default: none
an alternative way to define the GIF's duration
size resize the GIF to the dimensions of your Default: 300x200
choice (accepts width and height in pixels)
crop crop the GIF to the size of your choice Default: none
(accepts width and height in pixels)
fps specify a GIF quality (Frames per Second) Default: 15
of your choice (accepts number)
trailer set to "1" to create default trailer, Default: none
or specify custom trailer parameters

URL Encoding

Strictly speaking, it is always a safer method to URL encode video URLs before passing them into the API's url parameter. However, URL encoding is required in case your video URL contains the special character &.

Example URLs:

Find below an example video url that is required to be URL encoded in order to be processed correctly.

http://website.com?parameter=example&file=video.mp4

Example query:

This is how the example URL above has to be passed into an API request:

By providing the duration parameter in combination with start the giflayer API will be requested to generate a GIF starting at second 10 (start) and ending at second 15 (start + duration) of specified video.

FPS Example GIFs

The following three GIFs very well illustrate the differences in resolution based on your choice of FPS (Frames per Second). Click on each gray button to show the example GIF at the respective FPS rate.

Important: Please be aware that a GIF's FPS resolution has a significant impact on its file size. The above example GIF's file size amounts to 2.8MB (MegaByte) at 10 FPS, while the 30 FPS version almost reaches 7MB.

Trailer

Additionally to the conventional way (described up to this point) of generating GIFs, the giflayer API offers the capability of creating a default or customizable GIF trailer (preview) of the requested video file.

By appending the API's trailer parameter to the request URL and setting it to 1 you will request the API to make use of the default trailer functionality, which splits the requested video into 10 equal parts, and plays 10% of each part before jumping to the next one, until the 10th part has been reached.

Trailer - Advanced Functionality

In case the default usage of the API's trailer parameter does not fit your needs, the giflayer API also offers the capability to generate a customized trailer of the requested video.

As implied earlier, the trailer feature is based on two values: The amount of parts the requested video is split into, and the length of each part.

These two values are both specified by appending the trailer parameter to the API request URL and setting it to number of parts, part length (as % of part)

Example: User requests a 4-minute video and specifies trailer=4,5. The first number (4) indicates that the video is split into 4 equal parts, each 1 minute long. The second number (5) indicates that 5% (= 3 seconds) of each part are played, until all 4 parts have been played. The duration of this GIF trailer would therefore amount to 12 seconds (4 x 3 seconds).

set to 1 for default usage, or set to number of parts, part length as % of part (comma-separated) for custom usage.

-

Please note: The API's trailer parameter is not configured to accept decimals.

Important: The amount of trailer parts must be a numeric value between 2 and 20, and the part-length percentage must be a numeric value between 1 and 50.

Trailer - GIF Duration - Start & End

If no start, end or duration parameters are provided along with the trailer function, the giflayer API will automatically evaluate the entire length of the requested video for the creation of your trailer.

However, in order to restrict the trailer function to a certain timeframe, or to ensure a reduced GIF file size, you may specify these parameters according to to their usage guide above.

Important: Please note that since the standard GIF duration limit of 30 seconds is not applicable when working with trailers, GIF file sizes may be significantly larger.

Export to AWS S3

You may request the API to directly export your GIF to your AWS S3 Bucket. This can be done simply by appending your S3 Bucket path (format: s3://API_KEY:API_SECRET@bucket) to the API's export parameter.

Important: Uploading your GIF to the given S3 path may take several minutes to complete. Please be aware that our system can only attempt accessing the specified export path and cannot notify you in case your upload fails.

Export to FTP

You may also specify a custom ftp path to directly export captured GIFs to. This can be achieved simply by appending your desired FTP path (format: ftp://user:password@server) to the API's export parameter.

Important: Uploading your GIF to the given FTP path may take several minutes to complete. Please be aware that our system can only attempt accessing the specified export path and cannot notify you in case your upload fails.

Language Examples

PHP

Capture GIFs in PHP:

Find below a simple PHP function that lets you generate a GIF and define all required and optional parameters: