Requests are made of three components:
To construct a proper request, you will need to format the URI as follows:
An example request, to fetch a list of posts on a forum might be:
By default, requests are HTTP GET requests. However, many methods will require you to send POST data. Typically, we try to follow the standard of all read requests use GET, and write requests use POST.
In addition to the required parameters for each individual method, you will also need to send your API key, this is done differently depending on how you access the resource.
api_key with your public API key value. You will need to also ensure that you have added the domain you're accessing the API from to your list of domains for that application.
If you are using the server-side API, you will need to send
api_secret with your secret API key value.
For each request you should specify which version of the API you want to use. Currently, the default, and the only version available, is 3.0.
The resource path is made available to you in further documentation.
Disqus only supports one data format currently, JSON. However, we do also support JSONP response types, which are just a callback function wrapping the JSON output.
JSONP requests must pass an additional
callback parameter along with the rest of the request data.
Parameters have several considerations to be made within the API.
The first are multi value parameters. This simply means that the resource allows you to send multiple values for this single parameter. This can be done in two ways:
The second consideration are query types. Certain parameters allow more complex lookups by specifying a suffix on the parameter. For example, the user parameter typically allows you to look up a user by username, as well as by ID. To do this, you simply suffix the lookup key with
The response of your request will contain several key things:
HTTP status code
API response message
Let's take an example request:
$ curl -0 -L "http://disqus.com/api/3.0/trends/listThreads.json?api_key=API_PUBLIC_KEY_HERE"
"name": "Tv Shows",
"title": "Watch True Blood Online",