REST API Documentation

From Justin.tv API Wiki

Revision as of 19:03, 26 July 2012 by Hebo (Talk | contribs)
Jump to: navigation, search


Image:Ambox_notice.png Are you building an app that connects with Twitch? Use the Twitch API Instead!


Create your own Justin.tv apps! v1 of the Justin.tv API includes all the basic building blocks a developer needs to create an application that can browse channels, play live streams, allow users to broadcast live video, and interact with the Justin.tv social network backend. The API is composed of two distinct parts: Flash components, and the REST API.

REST API calls are either GET (for reads), or POST (for creates and updates). API calls are made to http://api.justin.tv/api/path/to/call.format.

Api calls requesting data in json format support jsonp, so you can use the api directly from javascript. Here is an example using the jQuery javascript library:

$.getJSON("http://api.justin.tv/api/clip/show/1278312.json?jsonp=?", function(a){alert(a.title);});

Return objects for various API calls are listed here.

Stream Methods

stream/list

Get information about a specific live stream, a category, a language, or get them all!

stream/summary

Get aggregate information about all the streams (total viewers, total number of streams, average bitrate)

stream/register_callback

Register a callback url for stream events on a channel - you can register for stream_up and stream_down

stream/unregister_callback

Unregister a pre-registered callback

stream/list_callbacks

List all the callbacks currently registered on a given channel

stream/search

Get information about the live stream results of a search query.

User Methods

user/show

Returns extended information for a user.

user/create (requires whitelist)

Creates a new user.

user/update

Updates an existing user.

user/friends

Get all users who are friends of a user.

user/favorites

Get all channels who are favorites of a user.

user/events

Get all events a user is subscribed to.


Channel Methods

Channel objects include embed code, status, title, etc.

channel/show

Returns extended information for a channel, specified by channel id or login.

channel/create (requires whitelist)

Creates a new user with a channel.

channel/update

Updates an existing channel.

channel/stream_key

Gets a channel's stream_key, which is needed for broadcasting from a source outside a Justin.tv embed.

channel/fans

Get users who are fans of a channel.

channel/archives

Get archives from a given channel.

channel/events

Get all events on a channel.

channel/embed

Get embed code for a channel.

channel/chat_embed

Get chat embed code for a channel.

channel/publisher_embed

Get the publisher embed code for a channel.

channel/commercial

Run a commercial on a channel.

Fan Methods

fan/create

Creates a new fan.

fan/destroy

Destroys a fan relationship.

Clip Methods

clip/show

Returns extended information for a clip, specified by clip id.

clip/update

Updates an existing clip.

clip/create

Creates a new clip on a channel.

clip/destroy

Destroys an existing clip.

clip/embed

Get embed code for a clip.

Chat Methods

chat/send_message

Post a message to a chatroom via oauth

Account Methods

account/fme_config

Gets the Flash Media Encoder config file for an authenticated channel. OAuth tokens for the requesting channel.

account/whoami

Returns the user object corresponding to the user who has authorized the access token you are making the request with.

Application Methods

application/rate_limit_status

Returns whether the IP address or application has been rate limited or not.

Category Methods

category/list

Returns a collection of channel categories.

Embed Methods

embed/from_url

Returns the embed code for the content contained on the page at a given url.

Client Libraries