This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
API
Keith Mitchell edited this page Feb 25, 2014
·
59 revisions
- reddit's built-in live API documentation
- The Apigee API console
- reddit supports OAuth for authentication.
- Don't forget the list of API Wrappers.
-
Make no more than thirty requests per minute. This allows some burstiness
to your requests, but keep it sane. On average, we should see no more than
one request every two seconds from you. Monitor the following response headers
to ensure that you're not exceeding the limits:
-
X-Ratelimit-Used
: Approximate number of requests used in this period -
X-Ratelimit-Remaining
: Approximate number of requests left to use -
X-Ratelimit-Reset
: Approximate number of seconds to end of period
-
- Change your client's User-Agent string to something unique and descriptive,
preferably referencing your reddit username.
- Example:
User-Agent: flairbot/1.0 by spladug
- Many default User-Agents (like "Python/urllib" or "Java") are drastically limited to encourage unique and descriptive user-agent strings.
- If you're making an application for others to use, please include a version number in the user agent. This allows us to block buggy versions without blocking all versions of your app.
- NEVER lie about your user-agent. This includes spoofing popular browsers and spoofing other bots. We will ban liars with extreme prejudice.
- Example:
- Most pages are cached for 30 seconds, so you won't get fresh data if you request the same page that often. Don't hit the same page more than once per 30 seconds.
- Requests for multiple resources at a time are always better than requests for single-resources in a loop. Talk to us on the mailing list or in #reddit-dev if we don't have a batch API for what you're trying to do.
- Our robots.txt is for search engines not API clients. Obey these rules for API clients instead.
See JSON for an overview of some of the response types.
Changes to the API can happen without warning if necessary, subscribe to /r/redditdev for announcements of changes.