Tag Info

Hot answers tagged

29

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.


15

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


13

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

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.1), 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. ...


10

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


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.


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.


8

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


8

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


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.


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


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

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

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


7

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.


7

Historical Note StackList is no longer available - the features that made it an attractive supplement to listing your app here have found their way into Stack Apps itself. This answer remains for historical purposes. Don't forget to also publish your app on stacklist.quickmediasolutions.com (404 Not Found) The site is shaping into a nice ...


7

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


6

Yes, you can change very nearly everything (and actually everything that's user entered) about an application after it's been registered. You should use the domain you intend to host the client-side app under as your OAuth Domain. While not strictly necessary, it's the sanest option.


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

It's the same as much of the web. As a rule, you don't want Content-Encoding: gzip or Content-Encoding: deflate a good 99.9999% of the time (to underestimate a bit). What you want is the actual content, exactly as it would be without the content-encoding, but to get it faster. That is to say, you want Transfer-Encoding: gzip. Transfer-Encoding: gzip also ...


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

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

Dates increase as time advances, so 1293861600 (Jan. 1st 2011) is greater than 946706400 (Jan 1st. 2000). Thus, a descending ordering puts the most recent dates first. Because sorting by dates is much more common than by name, ordering is descending by default.


6

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


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

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



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