Tag Info

Hot answers tagged

16

Purposefully not shown. The potential for abuse is way too high.


8

Do you mean to say how do I use this stuff? You can find the documentation here or there's a Get Started section at the right of this page. For example if you want to see a list of users you could send a web request to http://api.stackoverflow.com/1.0/users and parse then JSON response. Now if you want to find out details about a particular user lets say ...


7

You are getting the GZipped stream of the response content. Use DownloadData instead of DownloadString and uncompress the stream before passing it to the JSON deserializer (or whatever you plan to use). Alternatively, you can use the StackOverflow.Net library.


5

I believe that's a correct approach. There's a way to optimize it saving one request but it's a little bit unsafe for this bug: call /questions/{id}; If you get a result with a title parameter it's a question If you get a result without a title parameter it's an answer, thus you should call /answers/{id} for the title EDIT: I've just realized that ...


5

First of all, I'm guessing the HTTP 400 errors are directly related to the fact that you are transmitting the access_token over standard HTTP instead of HTTPS. The API (if I remember correctly) throws an error if you try to pass an access token over standard HTTP and immediately invalidates the token. You actually don't need to include an access_token to ...


4

See Kevin's answer here: http://stackapps.com/questions/408/what-is-the-errors-endpoint-used-for/411#411 RequestLimitExceeded = 4004


4

All responses from the API are compressed. You can specify the compression scheme (gzip or deflate) in the Accept-Encoding header. If you don't specify, one will be chosen for you. We used to throw up an error when a non-compressed request was received, but a frustrating number of proxies don't pass Accept-Encoding through properly; so instead we silently ...


4

Note: I'm the author of stack.PHP. You're likely running into rate limit issues. The API only allows you to make som many requests per second. Quoting from the question I linked to: The API will cut you off if you make more than 30 requests over 5 seconds to any single endpoint. Based on past experience, what you need to do is make sure that there is ...


4

You're talking about a number of things here, so let me see if I can explain them all: The code powering the API is (presumably) written in C# and is closed-source. The content provided by the API is licensed under a Creative Commons (w/ attribution) license. The applications / libraries that use the API can be under any license you choose. The logos, ...


4

No, not in version 1. User authentication (and the actions that go along with it, like voting and posting), might well turn up in version 2.


4

As I learned from George Edison in his comment, the server handles time in UTC format. Just replace your calls to DateTime.Now with DateTime.UtcNow or you can convert any DateTime to UTC format with the ToUniversalTime method. Just make sure not to call ToUniversalTime on the server's time, or it'll get messed up.


4

This will be fixed in the next build.


4

This is currently not possible via the API. The best you could do is have the user logged into a browser and then screen-scrape the stackoverflow.com/users/{user_id}/?tab=votes pages... Hardly an acceptable workaround. The Authentication doc, Scope section, does say: private_info - access full history of a user's private actions on the site. ...


3

Check out the enumerations page on the documentation.


3

Look to your right------> (where it says Get Started) Api is a REST implementation and as such has no 'download' You may access it right from your browser address bar or leverage one of the many client libraries that have been implemented. http://stackapps.com/questions/288/list-of-libraries If you are using JavaScript or C#, I would be remiss, as a ...


3

They have moved also these favicons (hard-coded in Swatch): http://sstatic.net/sf/favicon.ico http://sstatic.net/su/favicon.ico http://sstatic.net/sa/favicon.ico


3

Alright, here's what we're going to try. First off, we're not giving hard guarantees as to the maximum length of strings returned. Such a guarantee could create a situation where we might have to release an API revision just to accommodate increased text limits on the trilogy sites, or one - which is equally bad - where the API would return truncated ...


3

The payload seems to be limited to 3000 characters by the Stack Exchange engine itself: However, the actual field returned by the API may be longer, as the user's 3000, markdown characters are expanded into HTML. As stated in "Can we have maximum length of string in API help pages?", the API itself enforces no length limits on the data and... ...


3

The date is in "Unix epoch time", as described in the API-docs, Date Formats section. How you do the conversion depends on what language you are coding in. Here's one way in javascript: function unixEpochTime_TO_Date_DDMMYY (unixEpochTime, returnUTC) { var year, month, day; var dateObj = new Date (unixEpochTime * 1000); if (returnUTC) { ...


2

We're using number in the JSON sense of the word. number in that context does cover all the data types we're returning. I suppose it could be tightened up a bit, though... Descriptions of the types of number coming back are now part of the /help docs.


2

Honestly, I don't think it is a big enough deal to warrant all of this attention. I don't see why posting code samples should be Community Wiki, but if a Moderator believes that they should be, then that's fine. It was getting a bit annoying to see C# code samples posted all over the active question's page. I think a few is ok, but in my opinion, it was ...


2

Thanks for wrapping that up (+1) - a couple of recent topics are missing though, so here are More Common Questions Why is there no stable sort order for /sites? See How to order /sites result in a user friendly way to use it in our apps. for comments, discussion and workarounds. Why is the site creation date not available? See Can we add a ...


2

The body of a post is optionally returned on all methods that return "posts." /questions, /questions/{id}/answers, /users/{id}/questions, /answers/{id}, etc. all return the same "post object" I guess you'd say. The same code can be used to parse the post subset of fields, anyway. Kind of complicated, unfortunately. However, since /search is so expensive ...


2

As Jeff mentioned in the comment of my other answer, this information would be best put elsewhere... so... I have set up a MediaWiki installation for this here: http://stackoverflow.quickmediasolutions.com/wiki/ Update: The stackoverflow.quickmediasolutions.com subdomain appears to have been dead for a while. Here's what's left of the wiki at the Internet ...


2

This was fixed in the latest deploy.


2

/me/associated is the preferred way to turn an access_token into a list of users, it returns the collection of per-site user details that can be quickly fetched. It's basically the user's account tab. If you need more details about a user on a give site, then turn around and hit /me (or /users/{ids}) on the sites you've discovered via /me/associated. As ...


2

I found the answer. On the documentation page we find all needed information: Example: /2.1/questions? pagesize=50 fromdate=1371859200 todate=1372550400 order=desc sort=votes tagged=javascript site=stackoverflow ...


2

See the documentation for the /questions path and the question object spec. To get answers, merely use the /questions path with a filter that has answers enabled. To get the latest 30 questions, sort by activity, descending, and request only the first page with a page-size of 30. For example: ...


2

This was fixed in the latest deploy.



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