Tag Info

Hot answers tagged

25

Protip: when working with any API that returns JSON, install the JSONView Firefox Extension. By default, Firefox wants to download the application/json content type. This is not very helpful. JSONView changes the behavior so that you view the JSON in the browser, and additionally get syntax hi-lighting and expand/collapse.


16

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


12

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


11

Remember, you should only publicize your app if it can actually be used! I'm working on an idea for an app. In true "customer development" fashion, I'd like to publish the idea, with a screenshot of what it will look like, to see what kind of reaction it gets and what features people want it to have. It's not difficult to implement, but I'd rather ...


9

I suspect your problem (as I commented) is XSS related. Try using JSONP instead of raw JSON; we just added support for the jsonp parameter.


9

For the API, the day ends 24 hours after your first API call. A single IP address can only make a limited number of requests per day to the API. This limit is determined at first request time, and is dependent upon the presence of an API key.


8

Yeah... These are kind of complicated, but very flexible. They're also getting better docs soon-ish. Basically, min & max are the range of the sorted results to return. So, if you order a list of questions (pick your API method of choice) by votes, you can set min to 5 and max to 10 to only return questions that have a score of at least 5 and no more ...


8

All api results are gzipped. So what you are looking at is a gzipped binary blob. Simply decompress using a gzip implementation in R.


8

Just be reasonable. Trademark law is based on the principle of not confusing "the reasonable person" as to the origin of goods and services.


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.


7

As Kevin says, XSS. Try this instead: $.getJSON("http://api.stackoverflow.com/0.8/stats?jsonp=?", function(data){ alert(data.statistics[0]['total_questions']); });


7

Transfer-Encoding is hop-by-hop, while Content-Encoding is end-to-end. This means that if there is a proxy involved, anywhere, the proxy will see the TE gzip, unzip it, and not necessarily forward the request as TE gzip. So, the choices are CE gzip and always know what you will be getting, requiring logic to decompress the response. TE gzip and never ...


7

You need to encode the # character (to %23) http://api.stackoverflow.com/1.0/questions?title=true&tagged=c%23


7

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 ...


6

Now, I can confirm that changing my IP Address reset rate-limit to 10000 back. So, 10k limit is per IP Address, not globally.


6

Thanks for the help, S.Mark. Here's the answer: http://code.google.com/chrome/extensions/xhr.html You must register the API in your manifest.json file under permissions: ... "permissions": ["http://api.stackoverflow.com/"], ... }


6

Like so, in the query section of the URL: http://api.stackoverflow.com/0.8/questions/?body=true&field=value&field1=value1 See Wikipedia.


6

If you look on that password page, it says: Thank you for participating in the private API beta! We're now starting the public beta - you can find more information on http://stackapps.com. The dev.meta.stackoverflow.com site is no longer active. This is the new location for API related subjects. You should have goten an email notifying you of ...


6

Try this http://api.stackoverflow.com/0.8/questions/?tagged=gwt+google-app-engine


6

Yes. Your API key identifies your application for stat tracking purposes more-so than security purposes. It is safe to leave in a plain text, user readable, format.


6

A very low friction introduction to the API can be had with SOAPI-EXPLORE. It is always in sync with the current API and provides a documented interface for querying each route. It is a single file JavaScript application and requires no installation and may be right-click/saved or view source/saved and run locally if desired.


6

http://stackauth.com/1.0/sites will get you information about all the sites.


6

This isn't an answer, just an agreement with the original poster (though I might have couched my feelings in slightly less confrontational language). The API is beginning to feel rather like abandonware. My reasoning… Since the competition winners were announced, the API's not even been mentioned on the blog We've had no official word on updates and ...


6

In the documentation it tells you to set the sort parameter to hot, week or month (or votes, creation, featured, or activity (default)) EG: http://api.stackoverflow.com/1.1/questions?sort=hot


6

Most routes that take an ID, including the /users route, will accept multiple values separated by semicolons. For example, a query like /users/1%3B22656?site=stackoverflow will give you results for both user 1 and user 22656. You can combine up to 100 ids in this fashion.


6

This is what custom filters are for. For example, if you append &filter=!BGRhem4Z)WIti9lP55R*tgr(Jq_fHC to your query, above, you will get results without upvote_count, downvote_count, or owner information. (The first two aren't included by default anyway.) An easy way to create a filter is to use the filter-edit tool, on the appropriate doc page for ...


6

Markdown. While you could use HTML (just like you can in posts), each time you use HTML instead of Markdown to format a post, Evan Carroll rapes a little kitten and sticks another needle in his Jeff Atwood voodoo doll.


6

You need to pass in a sufficiently large pagesize value, per the documentation: The pagesize parameter for this method is unbounded, in acknowledgement that for many applications repeatedly fetching from /sites would complicate start-up tasks needlessly. Otherwise you'll only get 30 results, the default value for pagesize. Alternatively, you can page ...


6

You don't explicitly need permission, but you must follow certain rules and legal requirements. Refer to Jeff Atwood ♦'s answer to "Etiquette of Screen-scraping Stack Overflow?": We regularly block (IP range ban) unknown scrapers that do not identify themselves and/or have poor behavior patterns. These bans are permanent until someone emails us to make ...


5

You can use filter by names as you already mentioned, and it is the correct way because user names are not unique. You can sort it by reputation, name, creation date with ordering asc or desc In the response json, there is email hash, you can compare it with md5 hexdigest if you already have email addresses of users.



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