i can has API?

The Cheezburger API is here, and it gives you the power to post and access content on Cheezburger websites so that you can build web, mobile, and desktop apps that give users new and different Cheezburger experiences.

Some of the things you can do with the API include:

  • Post and retrieve assets (i.e., pictures with captions) on Cheezburger sites
  • Get information about Cheezburger sites that can be presented to users
  • Get user profile information, including avatar images

The Cheezburger API uses Representational State Transfer (REST). You will make HTTP requests, where GET is used to retrieve information and POST is used to post information, such as assets. Data is returned in the form of JavaScript Object Notation (JSON).

This overview topic describes how to obtain an App ID, API versions, the formats used by the API, and shortcuts for the current user. In addition, the following information is also included in the API documentation.


Obtaining a Client ID

To create an app, you must first obtain a Client ID and secret. Follow these steps:

  1. Sign In or Register an account on the Cheezburger Developer Portal. (Note: Use your same login and password from Cheezburger.com.)
  2. Select the My Apps tab
  3. Choose Set Up an Application
  4. Enter in your application information and click Set Up Application

You will be given a Client ID and a Client Secret. Store both of these in a safe place. The Client ID identifies your application, and it is used in authentication. It is not considered secret and may be embedded in, or distributed with, your application. The Client Secret must be kept secret and should not be embedded or otherwise distributed with your application. The Client Secret is not needed for client-side authentication.


Versions

There may be new versions of the API in the future. We have implemented versioning by including a version number in the URL path for the API. The current version of the API is “v1”, which you can see in the following example URL:

https://api.cheezburger.com/v1/assets

When developing your application, it is best to design it to use a specific version of the API so that your application does not inadvertently break when new versions of the API are released. Furthermore, if you utilize a global variable for the base portion of the URL (currently, https://api.cheezburger.com/v1), then this will make it easier to upgrade your application to future versions of the API.


Formats

Data is returned and posted in the format of JavaScript Object Notation (JSON). For individual values, there are four types of formats:

  • Numbers, which are all integers. This includes IDs.
  • Strings
  • Booleans, which have the values true and false
  • Date/Times, which are in Unix Epoch Time.


Paging

too much informationz

Certain endpoint methods return lists of objects. If the number of items in the list is large, then downloading it all at once may slow your app's user experience. To solve this, these methods have paging parameters that allow you to download the information in smaller pieces.

To use paging, first choose a page size, and set the page_size parameter, which is the number of items you wish to download. Then set the page parameter to 1 to download the first block of items. Next, set the page parameter to 2 to download the next block of items. Continue to do so until you are returned an empty list of items.

Note: Page numbers starts at 1, not 0.

Note: The maximum page size is 100.

Parameters

Use the following query parameters for paging:

Parameter Description Required Type
page The page index number. Default is 1. Optional integer
page_size The number of items to return in a page. Default is 10. Optional integer

Sample Requests

The following is a sample request using cURL.

Get items in a list of sites, numbers 6 through 10 in the list.

curl -G "https://api.cheezburger.com/v1/sites?page=2&page_size=5&access_token={token}


Shortcuts for the Current User

The current user is the user whose credentials are used to gain an access token. (See Authentication for more information.) Currently, two endpoints are available that use shortcuts called me and my to retrieve information that is specific to the current user.

  • The me endpoint returns user profile data for the current user
  • The my/sites endpoint returns sites that belong to the current user