Tag Info

Hot answers tagged

10

Another scenario to consider is testing. Granted tests shouldn't really be hitting the service that hard but I know for my library I have at least 50 integration test that when run all at once would it the /questions method with the same parameters many times in a minute. These requests are done anonymously (with no api key) so I am not sure if you treat ...


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.


4

You may not post data to the api but retrieving data in c# is quite simple. Create a project and get an api key. To get started, just make use your project's name, whatever it is and your profile url as the app's website. This information can be modified at any time in the future. Download the source code for Soapi.CS Either build or add a project ...


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

Obvious, but perhaps worth stating: An easy way for desktop apps to reduce API usage is to detect when the screensaver is active or the workstation is locked, and throttle or pause API calls. Use separate polling intervals for different types of data: you may need questions every minute, but can live with reputation updates every 5 minutes. Favor fewer API ...


3

Another good way to be conscientious to the API is think about timing. If your app has certain peaks hours, slow down on the calls after hours (If 75% of users are US, run at 1 call/min from 9-5, and 1 call/5 min the rest of the time) The same goes vice-versa. If your application isn't completely reliant on up-to-minute data during the day, slow down on the ...


3

You can get meta data about a site as well as about all sites and users within the Stack Exchange sites network, see e.g. the following routes: Api Routes /stats Gets various system statistics. StackAuth Routes /sites Returns a list of all the sites in the StackExchange network /users/{id}/associated Gets all the associated user accounts across ...


2

"I have established that I need to use this url: https://api.stackexchange.com/2.1/users/1272330?order=desc&sort=reputation&site=stackoverflow ..." That is the correct path to use, but the order and sort query string parameters are unnecessary since you will always be receiving only one item in the response. "I have a knowledge of PHP, HTML, ...



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