A tip for developers working with the Stack Exchange API.
5
votes
0answers
135 views
How to get the count of a query efficiently
To get the count of a query without returning results, simply specify pagesize=0.
http://api.stackoverflow.com/0.9/users?filter=mike&sort=name&pagesize=0
{
"total": 1161,
"page": 1,
...
5
votes
0answers
353 views
How to use min/max with sort
While some sort values make inference of the expected min/max values less than ambiguous, others do not.
Pending formal documentation, I hope this can serve as an informal reference.
Aggregated sort ...
4
votes
0answers
177 views
Announcement: StackExchange API Development Wiki
RIP August 24, 2010 - April 26, 2013
Due to lack of interest and the increasing burden of maintenance, I have decided to close down this wiki. Most of the information that it contains is ...
4
votes
0answers
3k views
How to call the API via JSONP in Plain Old JavaScript
This tips demonstrates how to call the API in JavaScript without the need of jQuery or other frameworks.
In a lot of cases you will find that the JSONP implementations provided in various frameworks ...
3
votes
0answers
63 views
recommended buffer size for markdown fields is conservative
I ran into a truncation error while inserting user data into a database using the documented field length (buffer size) of 3000.
So I redefined to nvarchar(max), pulled all users in the stack ...
3
votes
0answers
639 views
Dev-Tip: How to call the API in C# and Silverlight
This tip shows a simple and reliable way to create HttpWebRequest that are configured to properly query the api.
With the exception of the AutomaticDecompression assignment, this code can be used in ...
2
votes
0answers
285 views
How to retrieve paged API results in C# and Silverlight
In this tip we are going to leverage the SimpleRequestFactory and gather a multipage response.
Lets pull the first 5 pages of 100 users on stackapps.com.
NOTE: for Silverlight, substitute ...
0
votes
0answers
42 views
api domain object unique keys
For those who wish to maintain object graphs or to persist api domain objects authoritative documentation of the field(s) that define a unique key for the object would be of value.
Some are obvious ...