Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 14

A tip for developers working with the Stack Exchange API.

4 votes
0 answers
874 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. Let's pull the first 5 pages of 100 users on stackapps.com. NOTE: for Silverlight, substitute Newtonsoft. …
2 votes

API compliant request throttle implementations

C# sliding window throttle implementation This is the throttle implementation used by Soapi.CS. It is compatible with all .net platforms (desktop/silverlight/phone/mono) It has proven to provide max …
Community's user avatar
  • 1
5 votes
2 answers
2k views

API compliant request throttle implementations

Balancing compliance with Request Throttling Limits with maximum allowable throughput in our applications and libraries with any reliability requires self-throttling. This post is meant to be a repo …
4 votes
8 answers
4k views

How to format reputation numbers similar to Stack Exchange sites

UPDATE For JavaScript, see CMS's implementation below. It is much more elegant than the one I provide in the body of this Q. // formats a number similar to the way stack exchange sites / …
2 votes

How to monitor API version and site state

JavaSript / Soapi.JS (V2) Using Soapi.JS (V2) Yes, this is a teaser - v2 will be released before the weekend. var apiKey = "my-foo-bar-fu-is-strong"; var ctx = new Soapi.ApiContext(apiKey); ctx.init …
Community's user avatar
  • 1
9 votes
7 answers
4k views

How to format time since xxx e.g. "4 minutes ago" similar to Stack Exchange sites

function timeSince(date) { var seconds = Math.floor((new Date() - date) / 1000); var interval = Math.floor(seconds / 31536000); if (interval > 1) { return interval + " years"; …
2 votes
Accepted

How to check if a given question is changed

I have been working on another API recently so I may be a bit dull but my first impression is that the path of least resistance is to pull your question(s) with answers and comments disregarding ac …
Sky Sanders's user avatar
  • 12.1k
2 votes

How to format time since xxx e.g. "4 minutes ago" similar to Stack Exchange sites

C# and Javascript port of Bill's answer Works for me - adding it to both Soapi libraries. See the JS version in action here One thing to keep in mind is that dates coming from the API are UTC. In ord …
Community's user avatar
  • 1
3 votes
1 answer
99 views

How to generate a list of users ranked by bug report submissions.

The use case is to generate a list of bug report submissions, grouped by User, of the following counts in descending order: bug bug + status-completed bug + status-deferred bug + status-bydesign …
3 votes
3 answers
159 views

How to generate a list of users ranked by activity (question or answer count).

The use case is to generate a list of users ordered by activity, i.e. question_count or answer_count. e.g. total_(questions|answers) display_name [user_id] ----------------------------------------- …
3 votes
3 answers
289 views

How to calculate a list of users ranked by question favorite count totals.

The API provides methods to sort and filter individual questions by favorite count. In order to calculate the question favorite count totals per User, some grouping and set operations are required. …
3 votes
2 answers
184 views

How to calculate a list of users ranked by question score (votes sum) totals.

The API provides methods to sort and filter individual questions by score. In order to calculate the question score (votes sum) totals per User, some grouping and set operations are required. e.g. …
3 votes
2 answers
107 views

How to calculate a list of users ranked by question view count totals.

The API provides methods to sort and filter individual questions by view count. In order to calculate the question view count totals per User, some grouping and set operations are required. e.g. t …
2 votes

How to monitor API version and site state

C# / Soapi.CS using Soapi.CS // [Test] public void SiteMonitor() { Context.Options.LazyLoadingEnabled(true); Context.Sites.ForEach(site=> Console.WriteLine("{0} {1} {2} {3}", …
Community's user avatar
  • 1
2 votes

How to calculate a list of users ranked by question favorite count totals.

C# / Soapi.CS using Soapi.CS // Context .Official .StackApps .Questions .PageCount(0) .PageSize(100) .GroupBy(question => question.OwnerId) .Select(group => new { …
Community's user avatar
  • 1

15 30 50 per page