Tag Info

Hot answers tagged

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

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

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

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

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

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.


5

You don't need an API key until your app goes live. For small traffic amounts (under 300 requests/day) you can use the API without the key to test your app: Do I need an API key? A single IP 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. ...


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.


5

This is one of the fun, annoying quirks of the API. Currently there is no pragmatic way to find a user based on their name instead of ID. Furthermore, there is a better chance that Jon Skeet will be banned from the site for misuse than the dev's deciding to reveal people's OpenID. For now, you should direct users to go to their profile page and look at the ...


5

Here it is! SVG version here Note: the same restrictions on this trademarked icon that apply here, also apply to the icon above.


5

Soapi.CS/C# NOTE: this code has been quickly evolving into the functionality presented here. Eventually I will break it out into a simple exe such as listed below, but for now...... Currently the only way to find a user by the MD5 hash of a lowercased email address (user.email_hash as well as gravatar key) is to maintain a local datastore containing the ...


5

Update Ok, I see from comments that you are using phone7 - the story is slightly different than mainstream silverlight as there is ONLY ClientHttp stack and you will need to manually decompress, as you have found out. I use Silverlight.SharpZipLib for this purpose. Good luck. Here is a method that will work in Silverlight and Phone 7. You can use it for ...


5

The proposed "solutions" to this are all terrible*. Ip+Key Trivially forged. IP+AppId Trivially forged. IP+User-Agent Trivially forged. KeyOnly Surprise surprise, trivially forged. Now, authentication would give us a non-trivially forged token to throttle on. This is a planned improvement in a future API version, however this workaround would ...


5

Since the competition winners were announced, the API's not even been mentioned on the blog There is an entire site dedicated to applications on our API -- and you are on it! I refer people here all the time when they are looking for functionality we don't offer. Apps and wrappers have had no publicity or support from the SE team See above. ...


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

Not like this? http://api.stackoverflow.com/1.1/tags?pagesize=100&page=1 http://api.stackoverflow.com/1.1/tags?pagesize=100&page=2 ....


5

The X-RateLimit-Current header contains the requests you have left that particular day. The X-RateLimit-Max dictates the total amount of requests your app can make in total through that day. See the bottom two response headers in the screenshot.


5

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


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


5

By "bio" you mean the about me field, right? ... Any path that returns a user object will return the about_me property, but this is not returned by default. You have to use a filter that has about_me enabled. For example, here is a query to get your "About me" on stackapps: users-by-ids#ids=8109&filter=!.2mo6GlnpFPFeBKnaz&site=stackapps An ...


5

Since the .getTime() value is already in UTC, you can just divide by 1000, and round. That is: var apiDate = Math.round (new Date().getTime() / 1000); works just fine. apiDate is in "unix epoch time" and the API takes these values even if the API parameter is called a "Date". But, if you want to truncate to the date only, just use: var dateTime = ...


5

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


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

Did you make any requests earlier today without a key? The API only checks your key and sets a limit on the first request. 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.


4

No. [app]s are not owned, or operated by Stack Overflow Internet Services, Inc. meta.stackoverflow is for support, discussion, etc. focused on stackoverflow.com and the StackExchange family of sites. Not for support of third-party products, like [app]s Providing a means of reporting problems using an [app] is the responsibility of the [app] developer.


4

The date is Unix Epoch time, which is the number of seconds since 1/1/1970. The "time zone" is UTC, which is nearly equivalent to GMT. You can convert from UTC to local time in javascript using the method outlined here. Here are the functions I use to convert back and forth (code is C#): public static DateTime ConvertFromUnixTimestamp(double timestamp) { ...


4

Skys answer already denotes the reason and principle solution via curl library functions - regarding your specific question How can I see it as text using commandline? the curl shell command offers a built in solution as well, you'll need to add a parameter like so: curl --compressed http://api.stackoverflow.com/1.0/users/113124/favorites



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