CINXE.COM
Making Requests - API - Disqus
<!DOCTYPE html> <html lang="en-us"> <head> <link rel="shortcut icon" href="//a.disquscdn.com/1739888300/img/favicon16-32.ico" type="image/vnd.microsoft.icon"> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <meta http-equiv="Content-Language" content="en-us"> <meta name="keywords" content="Disqus, disqus.com, comments, blog, blogs, discussion"> <meta name="google" value="notranslate" /> <title> Making Requests - API - Disqus </title> <meta name="description" content="Disqus is a global comment system that improves discussion on websites and connects conversations across the web."> <script type="text/javascript" charset="utf-8"> document.domain = 'disqus.com'; if (window.context === undefined) { var context = {}; } context.disqusUrl = 'https://disqus.com'; context.revealUrl = 'http://hubspot.disqus.biz/reveal-by-disqus-organic'; context.disqusDomain = 'disqus.com'; context.mediaUrl = '//a.disquscdn.com/1739888300/'; context.uploadsUrl = '//a.disquscdn.com/uploads'; context.sslUploadsUrl = '//a.disquscdn.com/uploads'; context.loginUrl = 'https://disqus.com/profile/login/'; context.signupUrl = 'https://disqus.com/profile/signup/'; context.apiUrl = '//disqus.com/api/3.0/'; context.apiPublicKey = 'Y1S1wGIzdc63qnZ5rhHfjqEABGA4ZTDncauWFFWWTUBqkmLjdxloTb7ilhGnZ7z1'; context.forum = null; context.adminUrl = 'https://disqus.com'; context.urlMap = { 'signup': 'http://disqus.com/admin/signup/', 'dashboard': 'http://disqus.com/dashboard/', 'admin': 'https://disqus.com/admin/', 'logout': '//disqus.com/logout/', 'home': 'https://disqus.com', 'home_settings_profile': 'https://disqus.com/home/settings/profile/', 'for_websites': 'http://disqus.com/websites/', 'for_publishers': 'http://hubspot.disqus.biz/reveal-by-disqus-organic', 'login': 'https://disqus.com/profile/login/' }; context.navMap = { 'signup': '', 'dashboard': '', 'admin': '', 'addons': '' }; </script> <script src="//a.disquscdn.com/1739888300/js/src/auth_context.js" type="text/javascript" charset="utf-8"></script> <link rel="stylesheet" href="//a.disquscdn.com/1739888300/build/css/3c494014c9b1.css" type="text/css" /> <link href="//a.disquscdn.com/1739888300/css/facebox.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="//a.disquscdn.com/1739888300/build/js/abadd50d331d.js"></script> <script> // // shared/foundation.js // // This file contains the absolute minimum code necessary in order // to create a new application in the DISQUS namespace. // // You should load this file *before* anything that modifies the DISQUS global. // /*jshint browser:true, undef:true, strict:true, expr:true, white:true */ /*global DISQUS:true */ var DISQUS = (function (window, undefined) { "use strict"; var DISQUS = window.DISQUS || {}; // Exception thrown from DISQUS.assert method on failure DISQUS.AssertionError = function (message) { this.message = message; }; DISQUS.AssertionError.prototype.toString = function () { return 'Assertion Error: ' + (this.message || '[no message]'); }; // Raises a DISQUS.AssertionError if value is falsy DISQUS.assert = function (value, message, soft) { if (value) return; if (soft) window.console && window.console.log("DISQUS assertion failed: " + message); else throw new DISQUS.AssertionError(message); }; // Functions to clean attached modules (used by define and cleanup) var cleanFuncs = []; // Attaches a new public interface (module) to the DISQUS namespace. // For example, if DISQUS object is { 'a': { 'b': {} } }: // // DISQUS.define('a.b.c', function () { return { 'd': 'hello' }; }); will transform it into // -> { 'a': { 'b': { 'c': { 'd' : hello' }}}} // // and DISQUS.define('a', function () { return { 'x': 'world' }; }); will transform it into // -> { 'a': { 'b': {}}, 'x': 'world' } // // Attach modules to DISQUS using only this function. DISQUS.define = function (name, fn) { /*jshint loopfunc:true */ if (typeof name === 'function') { fn = name; name = ''; } var parts = name.split('.'); var part = parts.shift(); var cur = DISQUS; var exports = (fn || function () { return {}; }).call({ overwrites: function (obj) { obj.__overwrites__ = true; return obj; } }, window); while (part) { cur = (cur[part] ? cur[part] : cur[part] = {}); part = parts.shift(); } for (var key in exports) { if (!exports.hasOwnProperty(key)) continue; /*jshint eqnull:true */ if (!exports.__overwrites__ && cur[key] !== null) { DISQUS.assert(!cur.hasOwnProperty(key), 'Unsafe attempt to redefine existing module: ' + key, true /* soft assertion */); } cur[key] = exports[key]; cleanFuncs.push(function (cur, key) { return function () { delete cur[key]; }; }(cur, key)); } return cur; }; // Alias for DISQUS.define for the sake of semantics. // You should use it when you need to get a reference to another // DISQUS module before that module is defined: // // var collections = DISQUS.use('lounge.collections'); // // DISQUS.use is a single argument function because we don't // want to encourage people to use it instead of DISQUS.define. DISQUS.use = function (name) { return DISQUS.define(name); }; DISQUS.cleanup = function () { for (var i = 0; i < cleanFuncs.length; i++) { cleanFuncs[i](); } }; return DISQUS; })(window); /*jshint expr:true, undef:true, strict:true, white:true, browser:true */ /*global DISQUS:false*/ // // shared/corefuncs.js // DISQUS.define(function (window, undefined) { "use strict"; var DISQUS = window.DISQUS; var document = window.document; var head = document.getElementsByTagName('head')[0] || document.body; var jobs = { running: false, timer: null, queue: [] }; var uid = 0; // Taken from _.uniqueId DISQUS.getUid = function (prefix) { var id = ++uid + ''; return prefix ? prefix + id : id; }; /* Defers func() execution until cond() is true */ DISQUS.defer = function (cond, func) { function beat() { /*jshint boss:true */ var queue = jobs.queue; if (queue.length === 0) { jobs.running = false; clearInterval(jobs.timer); } for (var i = 0, pair; pair = queue[i]; i++) { if (pair[0]()) { queue.splice(i--, 1); pair[1](); } } } jobs.queue.push([cond, func]); beat(); if (!jobs.running) { jobs.running = true; jobs.timer = setInterval(beat, 100); } }; DISQUS.isOwn = function (obj, key) { // The object.hasOwnProperty method fails when the // property under consideration is named 'hasOwnProperty'. return Object.prototype.hasOwnProperty.call(obj, key); }; DISQUS.isString = function (str) { return Object.prototype.toString.call(str) === "[object String]"; }; /* * Iterates over an object or a collection and calls a callback * function with each item as a parameter. */ DISQUS.each = function (collection, callback) { var length = collection.length, forEach = Array.prototype.forEach; if (!isNaN(length)) { // Treat collection as an array if (forEach) { forEach.call(collection, callback); } else { for (var i = 0; i < length; i++) { callback(collection[i], i, collection); } } } else { // Treat collection as an object for (var key in collection) { if (DISQUS.isOwn(collection, key)) { callback(collection[key], key, collection); } } } }; // Borrowed from underscore DISQUS.extend = function (obj) { DISQUS.each(Array.prototype.slice.call(arguments, 1), function (source) { for (var prop in source) { obj[prop] = source[prop]; } }); return obj; }; DISQUS.serializeArgs = function (params) { var pcs = []; DISQUS.each(params, function (val, key) { if (val !== undefined) { pcs.push(key + (val !== null ? '=' + encodeURIComponent(val) : '')); } }); return pcs.join('&'); }; DISQUS.serialize = function (url, params, nocache) { if (params) { url += (~url.indexOf('?') ? (url.charAt(url.length - 1) == '&' ? '': '&') : '?'); url += DISQUS.serializeArgs(params); } if (nocache) { var ncp = {}; ncp[(new Date()).getTime()] = null; return DISQUS.serialize(url, ncp); } var len = url.length; return (url.charAt(len - 1) == "&" ? url.slice(0, len - 1) : url); }; var TIMEOUT_DURATION = 2e4; // 20 seconds var addEvent, removeEvent; // select the correct event listener function. all of our supported // browsers will use one of these if ('addEventListener' in window) { addEvent = function (node, event, handler) { node.addEventListener(event, handler, false); }; removeEvent = function (node, event, handler) { node.removeEventListener(event, handler, false); }; } else { addEvent = function (node, event, handler) { node.attachEvent('on' + event, handler); }; removeEvent = function (node, event, handler) { node.detachEvent('on' + event, handler); }; } DISQUS.require = function (url, params, nocache, success, failure) { var script = document.createElement('script'); var evName = script.addEventListener ? 'load' : 'readystatechange'; var timeout = null; script.src = DISQUS.serialize(url, params, nocache); script.async = true; script.charset = 'UTF-8'; function handler(ev) { ev = ev || window.event; if (!ev.target) { ev.target = ev.srcElement; } if (ev.type != 'load' && !/^(complete|loaded)$/.test(ev.target.readyState)) { return; // Not ready yet } if (success) { success(); } if (timeout) { clearTimeout(timeout); } removeEvent(ev.target, evName, handler); } if (success || failure) { addEvent(script, evName, handler); } if (failure) { timeout = setTimeout(function () { failure(); }, TIMEOUT_DURATION); } head.appendChild(script); return DISQUS; }; DISQUS.requireStylesheet = function (url, params, nocache) { var link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = DISQUS.serialize(url, params, nocache); head.appendChild(link); return DISQUS; }; DISQUS.requireSet = function (urls, nocache, callback) { var remaining = urls.length; DISQUS.each(urls, function (url) { DISQUS.require(url, {}, nocache, function () { if (--remaining === 0) { callback(); } }); }); }; DISQUS.injectCss = function (css) { var style = document.createElement('style'); style.setAttribute('type', 'text/css'); // Make inline CSS more readable by splitting each rule onto a separate line css = css.replace(/\}/g, "}\n"); if (window.location.href.match(/^https/)) css = css.replace(/http:\/\//g, 'https://'); if (style.styleSheet) { // Internet Explorer only style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); } head.appendChild(style); }; DISQUS.isString = function (val) { return Object.prototype.toString.call(val) === '[object String]'; }; }); /*jshint boss:true*/ /*global DISQUS */ DISQUS.define('Events', function (window, undefined) { "use strict"; // Returns a function that will be executed at most one time, no matter how // often you call it. Useful for lazy initialization. var once = function (func) { var ran = false, memo; return function () { if (ran) return memo; ran = true; memo = func.apply(this, arguments); func = null; return memo; }; }; var has = DISQUS.isOwn; var keys = Object.keys || function (obj) { if (obj !== Object(obj)) throw new TypeError('Invalid object'); var keys = []; for (var key in obj) if (has(obj, key)) keys[keys.length] = key; return keys; }; var slice = [].slice; // Backbone.Events // --------------- // A module that can be mixed in to *any object* in order to provide it with // custom events. You may bind with `on` or remove with `off` callback // functions to an event; `trigger`-ing an event fires all callbacks in // succession. // // var object = {}; // _.extend(object, Backbone.Events); // object.on('expand', function(){ alert('expanded'); }); // object.trigger('expand'); // var Events = { // Bind an event to a `callback` function. Passing `"all"` will bind // the callback to all events fired. on: function (name, callback, context) { if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this; this._events = this._events || {}; var events = this._events[name] || (this._events[name] = []); events.push({callback: callback, context: context, ctx: context || this}); return this; }, // Bind an event to only be triggered a single time. After the first time // the callback is invoked, it will be removed. once: function (name, callback, context) { if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this; var self = this; var onced = once(function () { self.off(name, onced); callback.apply(this, arguments); }); onced._callback = callback; return this.on(name, onced, context); }, // Remove one or many callbacks. If `context` is null, removes all // callbacks with that function. If `callback` is null, removes all // callbacks for the event. If `name` is null, removes all bound // callbacks for all events. off: function (name, callback, context) { var retain, ev, events, names, i, l, j, k; if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this; if (!name && !callback && !context) { this._events = {}; return this; } names = name ? [name] : keys(this._events); for (i = 0, l = names.length; i < l; i++) { name = names[i]; if (events = this._events[name]) { this._events[name] = retain = []; if (callback || context) { for (j = 0, k = events.length; j < k; j++) { ev = events[j]; if ((callback && callback !== ev.callback && callback !== ev.callback._callback) || (context && context !== ev.context)) { retain.push(ev); } } } if (!retain.length) delete this._events[name]; } } return this; }, // Trigger one or many events, firing all bound callbacks. Callbacks are // passed the same arguments as `trigger` is, apart from the event name // (unless you're listening on `"all"`, which will cause your callback to // receive the true name of the event as the first argument). trigger: function (name) { if (!this._events) return this; var args = slice.call(arguments, 1); if (!eventsApi(this, 'trigger', name, args)) return this; var events = this._events[name]; var allEvents = this._events.all; if (events) triggerEvents(events, args); if (allEvents) triggerEvents(allEvents, arguments); return this; }, // Tell this object to stop listening to either specific events ... or // to every object it's currently listening to. stopListening: function (obj, name, callback) { var listeners = this._listeners; if (!listeners) return this; var deleteListener = !name && !callback; if (typeof name === 'object') callback = this; if (obj) (listeners = {})[obj._listenerId] = obj; for (var id in listeners) { listeners[id].off(name, callback, this); if (deleteListener) delete this._listeners[id]; } return this; } }; // Regular expression used to split event strings. var eventSplitter = /\s+/; // Implement fancy features of the Events API such as multiple event // names `"change blur"` and jQuery-style event maps `{change: action}` // in terms of the existing API. var eventsApi = function (obj, action, name, rest) { if (!name) return true; // Handle event maps. if (typeof name === 'object') { for (var key in name) { obj[action].apply(obj, [key, name[key]].concat(rest)); } return false; } // Handle space separated event names. if (eventSplitter.test(name)) { var names = name.split(eventSplitter); for (var i = 0, l = names.length; i < l; i++) { obj[action].apply(obj, [names[i]].concat(rest)); } return false; } return true; }; // A difficult-to-believe, but optimized internal dispatch function for // triggering events. Tries to keep the usual cases speedy (most internal // Backbone events have 3 arguments). var triggerEvents = function (events, args) { var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2]; switch (args.length) { case 0: while (++i < l) { (ev = events[i]).callback.call(ev.ctx); } return; case 1: while (++i < l) { (ev = events[i]).callback.call(ev.ctx, a1); } return; case 2: while (++i < l) { (ev = events[i]).callback.call(ev.ctx, a1, a2); } return; case 3: while (++i < l) { (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); } return; default: while (++i < l) { (ev = events[i]).callback.apply(ev.ctx, args); } } }; var listenMethods = {listenTo: 'on', listenToOnce: 'once'}; // Inversion-of-control versions of `on` and `once`. Tell *this* object to // listen to an event in another object ... keeping track of what it's // listening to. DISQUS.each(listenMethods, function (implementation, method) { Events[method] = function (obj, name, callback) { var listeners = this._listeners || (this._listeners = {}); var id = obj._listenerId || (obj._listenerId = DISQUS.getUid('l')); listeners[id] = obj; if (typeof name === 'object') callback = this; obj[implementation](name, callback, this); return this; }; }); // Aliases for backwards compatibility. Events.bind = Events.on; Events.unbind = Events.off; return Events; }); // used for /follow/ /login/ /signup/ social oauth dialogs // faking the bus DISQUS.use('Bus'); _.extend(DISQUS.Bus, DISQUS.Events); </script> <script src="//a.disquscdn.com/1739888300/js/src/global.js" charset="utf-8"></script> <script type="text/javascript"> if (window.AB_TESTS === undefined) { var AB_TESTS = {}; } </script> <script type="text/javascript" charset="utf-8"> // Global tests $(document).ready(function() { $('a[rel*=facebox]').facebox(); }); </script> <script type="text/x-underscore-template" data-template-name="global-nav"> <% var has_custom_avatar = data.avatar_url && data.avatar_url.indexOf('noavatar') < 0; %> <% var has_custom_username = data.username && data.username.indexOf('disqus_') < 0; %> <% if (data.username) { %> <% if (data.has_forums) { %> <li class="admin<% if (has_custom_avatar || !has_custom_username) { %> avatar-menu-admin<% } %>" data-analytics="header admin"><a href="<%= data.urlMap.admin %>"><strong>Admin</strong></a></li> <% } %> <li class="user-dropdown dropdown-toggle<% if (has_custom_avatar || !has_custom_username) { %> avatar-menu<% } else { %> username-menu<% } %>" data-analytics="header username dropdown" data-floater-marker="<% if (has_custom_avatar || !has_custom_username) { %>square<% } %>"> <a href="<%= data.urlMap.home %>/<%= data.username %>/"> <% if (has_custom_avatar) { %> <img src="<%= data.avatar_url %>" class="avatar"> <% } else if (has_custom_username) { %> <%= data.username %> <% } else { %> <img src="<%= data.avatar_url %>" class="avatar"> <% } %> <span class="caret"></span> </a> <ul class="clearfix dropdown"> <li data-analytics="header view profile"><a href="<%= data.urlMap.home %>/<%= data.username %>/">View Profile</a></li> <li class="js-edit-profile" data-analytics="header edit profile"><a href="<%= data.urlMap.home_settings_profile %>">Edit Profile</a></li> <li class="logout" data-analytics="header logout"><a href="<%= data.urlMap.logout %>">Logout</a></li> </ul> </li> <% } else { %> <li class="link-login" data-analytics="header login"><a href="<%= data.urlMap.login %>?next=<%= encodeURIComponent(document.location.href) %>">Log in</a></li> <% } %> </script> <!--[if lte IE 7]> <script src="//a.disquscdn.com/1739888300/js/src/border_box_model.js"></script> <![endif]--> <!--[if lte IE 8]> <script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.5.3/modernizr.min.js"></script> <script src="//a.disquscdn.com/1739888300/js/src/selectivizr.js"></script> <![endif]--> <script type="text/javascript" charset="utf-8"> // Global tests $(document).ready(function() { $('a[rel*=facebox]').facebox(); }); </script> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-MRHN8JCT');</script> <!-- End Google Tag Manager --> </head> <body class="labs" id=""> <header class="global-header"> <nav class="global-nav"> <a href="/" class="logo" data-analytics="site logo"><img src="//a.disquscdn.com/1739888300/img/disqus-logo-alt-hidpi.png" width="102" height="20" alt="Disqus" title="Disqus - Discover your community"/></a> <ul class="nav pills" style="position: relative;"> <script type="text/x-underscore-template" class="js-inline-template"> <%= template.loadById('global-nav') %> </script> <noscript> <li data-analytics="header for websites"><a href="http://disqus.com/websites/">Features</a></li> <li class="link-login" data-analytics="header login"><a href="https://disqus.com/profile/login/">Log in</a></li> </noscript> </ul> </nav> </header> <div id="content"> <div class="container"> <div id="content-heading"> <h1 id="title">API Resources</h1> <div class="clear"></div> </div> <div class="box"> <div class="tabs"> <ul class="nav pills" style="position: relative;"> <li class=" selected"><a href="https://disqus.com/api/docs/">Documentation</a></li> <li class=""><a href="https://disqus.com/api/applications/">Applications</a></li> <li class=""><a href="https://disqus.com/api/console/">Console</a></li> </ul> </div> <div id="subnav" class="secondary secondary-nav"> <ul> <li><a href="https://disqus.com/api/docs/">Documentation Home</a></li> <li class=" selected"><a href="https://disqus.com/api/docs/requests/">Making Requests</a></li> <li class=""><a href="https://disqus.com/api/docs/auth/">Authentication</a></li> <li class=""><a href="https://disqus.com/api/docs/permissions/">Permissions</a></li> <li class=""><a href="https://disqus.com/api/docs/cursors/">Pagination</a></li> <!-- <li class=""><a href="https://disqus.com/api/docs/signing/">Signing Requests</a></li> --> <li class=""><a href="https://disqus.com/api/docs/images/">Favicons and Avatars</a></li> <li class=""><a href="https://disqus.com/api/docs/errors/">Error Codes</a></li> </ul> </div> <div class="primary primary-with-nav main docs"> <h2>Request and Response Formats</h2> <div class="section"> <p>The Disqus API works over the HTTP protocol. It supports both server-side (secret key) methods, as well as a public facing JavaScript API using your public key and HTTP referrer checks. In general, read requests are made with <strong>GET</strong> and write requests are made with <strong>POST</strong>.</p> </div> <div class="section"> <h3>Constructing Requests</h3> <p>Requests are made of three components:</p> <ul> <li>API version</li> <li>Resource path</li> <li>Output type</li> </ul> <p>To construct a proper request, you will need to format the URI as follows:</p> <pre>https://disqus.com/api/{version}/{resource}.{output_type}</pre> <p>An example request, to fetch a list of posts on a forum might be:</p> <pre>https://disqus.com/api/3.0/forums/listPosts.json?forum=disqus</pre> <p>Note: We recommend using <strong>SSL for all requests</strong> to the API.</p> <p>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.</p> <p>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.</p> <p>If you are using the public-facing JavaScript API, you will need to send <code>api_key</code> 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.</p> <p>If you are using the server-side API, you will need to send <code>api_secret</code> with your secret API key value.</p> </div> <div class="section"> <h3>API Version</h3> <p>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.</p> </div> <div class="section"> <h3>Resource Path</h3> <p>The resource path is made available to you in further documentation.</p> </div> <div class="section"> <h3>Data Formats</h3> <p>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. Callbacks are only valid in GET requests.</p> <pre>$ curl -0 -L "<a href="https://disqus.com/api/console/?endpoint=trends%2FlistThreads&callback=foo">https://disqus.com/api/3.0/trends/listThreads.json?api_key=API_PUBLIC_KEY_HERE&callback=foo</a>" foo({ "code": 0, "response": [ { "thread": { "forum": { "id": "cucirca", "name": "Tv Shows", "founder": 996907, "favicon": { "permalink": "https://disqus.com/api/forums/favicons/cucirca.jpg", "cache": "https://a.disquscdn.com/uploads/forums/20/8466/favicon.png" } }, "author": 996907, "title": "Watch True Blood Online", "link": "http://www.cucirca.com/2009/05/27/watch-true-blood-online/", "closed": false, "id": 40385200, "createdAt": "2009-10-19T04:51:26" }, "comments": 14605, "score": "2.9408284023668639", "link": "http://www.cucirca.com/2009/05/27/watch-true-blood-online/", "likes": 62, "commentLikes": 9884 } ] })</pre> <h3>Parameters</h3> <p>Parameters have several considerations to be made within the API.</p> <p>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:</p> <ol> <li>param=foo&param=bar (preferred)</li> <li>param[]=foo&param[]=bar</li> </ol> <p>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 <code>:username</code>.</p> <ul> <li>user:username=foobar</li> <li>user=13</li> </ul> </div> <div class="section"> <h3>Responses</h3> <p>The response of your request will contain several key things:</p> <ul> <li>HTTP status code</li> <li>API status <code>code</code></li> <li>API response message</li> </ul> <p>Let's take an example request:</p> <pre>$ curl -0 -L "<a href="https://disqus.com/api/console/?endpoint=trends%2FlistThreads">https://disqus.com/api/3.0/trends/listThreads.json?api_key=API_PUBLIC_KEY_HERE</a>" { "code": 0, "response": [ { "thread": { "forum": { "id": "cucirca", "name": "Tv Shows", "founder": 996907, "favicon": { "permalink": "https://disqus.com/api/forums/favicons/cucirca.jpg", "cache": "https://a.disquscdn.com/uploads/forums/20/8466/favicon.png" } }, "author": 996907, "title": "Watch True Blood Online", "link": "http://www.cucirca.com/2009/05/27/watch-true-blood-online/", "closed": false, "id": 40385200, "createdAt": "2009-10-19T04:51:26" }, "comments": 14605, "score": "2.9408284023668639", "link": "http://www.cucirca.com/2009/05/27/watch-true-blood-online/", "likes": 62, "commentLikes": 9884 } ] }</pre> <h3 id="data-availability">Data Availability</h3> <p>Some response data, particularly personally-identifiable information, is available only in certain situations. OAuth is always required.</li></p> </div> </div> <div class="clear"></div> </div> </div> </div> <footer class="global-footer"> <nav class="footer-nav"> <ul> <li data-analytics="footer for websties"><a href="http://disqus.com/features/">Features</a></li> <li data-analytics="footer about"><a href="http://disqus.com/about/">How Disqus Works</a></li> <li data-analytics="footer brand"><a href="http://disqus.com/pages/style-guide/">Logos</a></li> <li data-analytics="footer docs"><a href="https://help.disqus.com">Help</a></li> <li data-analytics="footer blog"><a href="http://blog.disqus.com">Blog</a></li> <li data-analytics="footer api"><a href="https://disqus.com/api/docs/">API</a></li> <li data-analytics="footer data"><a href="https://data.disqus.com/">Data Services</a></li> <li data-analytics="footer jobs"><a href="http://disqus.com/jobs/">Jobs</a></li> <li data-analytics="footer terms"><a href="https://docs.disqus.com/kb/terms-and-policies/">Terms & Policies</a></li> </ul> <span class="copyright">© 2025 · <a href="/"class="disqus">Disqus</a></span> </nav> </footer> <script> (function (){ // adds a classname for css to target the current page without passing in special things from the server or wherever // replacing all characters not allowable in classnames var newLocation = encodeURIComponent(window.location.pathname).replace(/[\.!~*'\(\)]/g, '_'); // cleaning up remaining url-encoded symbols for clarity sake newLocation = newLocation.replace(/%2F/g, '-').replace(/^-/, '').replace(/-$/, ''); if (newLocation === '') { newLocation = 'homepage'; } $('body').addClass('' + newLocation); }()); $(function ($) { // adds 'page-active' class to links matching the page url $('a[href="' + window.location.pathname + '"]').addClass('page-active'); }); $(document).delegate('[data-toggle-selector]', 'click', function (e) { var $this = $(this); $($this.attr('data-toggle-selector')).toggle(); e.preventDefault(); }); </script> <!-- helper jQuery tmpl partials --> <script type="text/x-jquery-tmpl" id="profile-metadata-tmpl"> data-profile-username="${username}" data-profile-hash="${emailHash}" href="/${username}" </script> <script type="text/x-jquery-tmpl" id="profile-link-tmpl"> <a class="profile-launcher" {{tmpl "#profile-metadata-tmpl"}} href="/${username}">${name}</a> </script> <script src="//a.disquscdn.com/1739888300/js/src/templates.js"></script> <script src="//a.disquscdn.com/1739888300/js/src/modals.js"></script> <script> DISQUS.ui.config({ disqusUrl: 'https://disqus.com', mediaUrl: '//a.disquscdn.com/1739888300/' }); </script> </body> </html>