We’re rewarding the question askers & reputations are being recalculated! Read more.

Hot answers tagged

27

There is no tutorial for the API, nor is there likely to be one -- at least officially. There is a "Hello World" introduction. To use the current API (version 2.2), you really only need to know/do: How to make an HTTP GET request, in the language of your choice. There are also various user-supplied libraries in .net, PHP, Python, etc. to help with this. ...


15

You'll need to quote that URL. wget 'http://api.stackexchange.com/2.0...&site=stackoverflow' ^ ^ (And note that the payload is gzip-compressed.)


13

Funny story... When I first joined the team here at Stack Exchange, Jeff just went around on the trilogy sites and made me a moderator... And he used the "elected" route instead of the "appointed" route, for reasons that are no doubt lost to time (or maybe they're preserved in chat, I can't be bothered to search). This problem shows up on Super User and ...


12

First of all, version 1.1 of the API has been deprecated for quite some time now. Users are strongly encouraged to move their applications over to version 2.1. The URL for retrieving information about a question looks something like this: http://api.stackexchange.com/2.1/questions/ question_id ?site= site_name For example, to retrieve information about ...


11

As long as has_more is set to true there is more data available. You can get this data by increasing the page parameter in your request subsequently and running new request with that changed page parameter. The next url for your example would then be https://api.stackexchange.com/docs/users#page=2&pagesize=100&order=desc&sort=reputation&...


11

Refer to the Stack Exchange API, Authentication docs. It looks like you are trying to authenticate using either a server you do not control, or a local server that is not on the public internet. Crucial Points: Do not specify a redirect_uri to any server that you do not control. When you use something like redirect_uri=https://www.yahoo.com/, then a third ...


10

While this is not available I don't think SE can do much to prevent it. I don't have any easily readable code to give you code example, but the theory is following: The upload request: To upload images to Stack Exchange, you must send following POST request to https://__HOST__/upload/image: fkey: we'll talk about this token later source: web/computer ...


8

The unofficial Winterbash inbox API If you have any user's account_id then the hats information is just one call away. And the call is http://winterbash2014.stackexchange.com/api/inbox?accountId=<account_id> For example, hats information about me can be retrieved via http://winterbash2014.stackexchange.com/api/inbox?accountId=4996787 But here are ...


7

Every response from the API can be cached for up to a minute, so making the same request multiple times in that time-frame typically won't return different results. We make note of this in the throttle documentation: While not strictly a throttle, the Stack Exchange employs heavy caching and as such no application should make semantically identical ...


7

Oy, that was an annoying one. Subtle, as the bug only happened when you're not logged in but would be automatically logged in when you visit stackexchange.com. The actual root cause was just over-encoding a url.


7

You cannot do this. A delete feature has been requested and requested again (with status-planned given about 3.5 years ago). Register your desire for this by immediately upvoting these posts: Deleting an application key? How to delete an OAuth (2.0) API key? (Theoretically, if those feature requests get enough upvotes, they might get some developer love.)...


7

Confirmed; see bottom section, below. However, please refer to Provide a way to retrieve questions and answers that have been deleted -- which is "status-planned". This is a feature, not a bug. And this kind of feature has been requested many times. So, shush please, don't ruin it for us. ;) Confirmation info: You can see this behavior (for now) with this ...


7

Just use the plain /users/{ids} route. (For network-wide score, see the bottom section, below.) if you run it on your userid, it currently returns: { "items": [ { ... "reputation": 354, ... Which is what you expected. The route you used, /users/{ids}/reputation, has a different purpose. Refer to its doc page: Gets a subset of the ...


6

No, this is not available. Something like it may be available in the V3.0 timeframe, but I can't commit to that at this time.


6

AFAIK StackExchange network uses gravatars. Hence you can get their profile picture from their email address (check the gravatar site for details).


6

Actually this can be done with using the rss feed channel on ifttt. together with the rss feed from the Stack2rss app that transforms stackoverflow api queries to an rss feed. like: http://stack2rss.stackexchange.com/stackoverflow/users/{{your user id}}/questions?body=true you should check the api for the specific query you like (respone, specific ...


6

You can see your apps, that you registered with the registration page, by going to: stackapps.com/apps/oauth This page is different for every user and you will be forced to log-in to see it. The only place I have ever found this link is in a sidebar on Stack App's home page:


6

Yes, that bug is annoying, especially since specifying a todate that's before the fromdate returns a valid result set, EG: { "items": [], "has_more": false, "quota_max": 10000, "quota_remaining": 9995 } -- rather than an error. Having the dates be equal is theoretically possible. Having negative time is impossible (in this context). However, ...


6

You can create and edit filters from the documentation page of the API endpoint. So you start at the Index of all endpoints. There you'll find /users/{id}/answers. On the right at the top of the parameter block you'll find the filter dialog: When you click the [edit] link the filter dialog opens: Where you can expand any the [types] provided by this ...


6

See How API Keys Work. It's six years old, but a leading API developer said: ... If you can demonstrate a need for a higher request quota, contact us. However, the Key limit should be sufficient for development, so please only request an increased quota when your application is live and has a non-trivial number of users. (Emphasis and contact link ...


6

You cannot get the days visited, nor consecutive, information for a user because that is private information(Poster is SE representative). Stack Exchange is supposed to be about the content, not the people. And knowing people's (more detailed) visit history is a social metric, not an on-topic bit of information. In a similar question, one power-user put it ...


5

No, Area51 isn't in the API; it's different enough from the Q&A sites that it'd have to have a rather different one anyway. There are currently no plans to make an Area51 API either.


5

You can get data close-enough to "real time" for most practical purposes. See the StackHose app, for example. Read the page about the API's Throttles and Quotas. From that page we can deduce: The maximum, burst, request rate is 30 requests per second, and this risks getting your app shut down. Your app will never be allowed more than 10,000 requests per ...


5

For analyzing large chunks of data, don't use the API. Use the Stack Exchange Data Explorer (SEDE), that's what it's there for. SEDE data lags real-time by 1 to 5 weeks, but that's no big problem for most statistical purposes. For intense "Big data" analysis beyond even SEDE's capabilities, use the quarterly data dumps. (Thanks, Tim Stone, for the reminder....


5

Nope. Neither the user_timeline object, nor the user object return any flagging information, at all. (as of API version 2.2). The question, answer, and comment objects can return a can_flag boolean, but this does not necessarily indicate that the user has already flagged, and it returns false for a variety of reasons. Flagging history is especially ...


5

http://winterbash2014.stackexchange.com/api/user-hats?userId=29538&host=stackapps.com This returns an array of arrays. Each inner array contains three integers: The Id of the hat The number of times the user has earned this hat, all over the network 1 if the user has earned this hat on this particular site (Stack Apps, in this example); 0 otherwise.


5

I don't believe that that route accepts POST requests (as it's non-actionable), so you should have better luck sending a GET request instead. Routes that require auth tokens necessitate HTTPS, but still expect GET for read requests, and POST for writes.


5

You can use /users/{ids}/associated Try it for your network account Returns all of a user's associated accounts, given their account_ids in {ids}. {ids} can contain up to 100 semicolon delimited ids, to find ids programatically look for account_id on user objects. You can filter the network_users returned by this method with the types parameter....


Only top voted, non community-wiki answers of a minimum length are eligible