uHunt API (BETA)
real-time statistics service

How to use

You can call any of the service URL in the next sections directly from a client browser (it allows AJAX requests from any origin). It will return a JSON formatted results. Please be considerate accessing these services. The sections below are the list of all available services. Note that these services are not reliable yet. Use it at your own risk.

Change Log

Convert Username to UserID

URL : http://uhunt.felix-halim.net/api/uname2uid/{uname}.

The {uname} is the username to be converted. The service will return the user ID of that username.

Problem List

URL : http://uhunt.felix-halim.net/api/p.

Returns the list of problems at UVa in Javascript array format. Each problem is defined as an array of 19 values:

  1. Problem ID
  2. Problem Number
  3. Problem Title
  4. Number of Distinct Accepted User (DACU)
  5. Best Runtime of an Accepted Submission
  6. Best Memory used of an Accepted Submission
  7. Number of No Verdict Given (can be ignored)
  8. Number of Submission Error
  9. Number of Can't be Judged
  10. Number of In Queue
  11. Number of Compilation Error
  12. Number of Restricted Function
  13. Number of Runtime Error
  14. Number of Output Limit Exceeded
  15. Number of Time Limit Exceeded
  16. Number of Memory Limit Exceeded
  17. Number of Wrong Answer
  18. Number of Presentation Error
  19. Number of Accepted

Specific Problem

URL : http://uhunt.felix-halim.net/api/p/id/{problem-id}.

To view specific problem by {problem-id}.

URL : http://uhunt.felix-halim.net/api/p/num/{problem-number}.

To view specific problem by {problem-number}.

Live Events

This service is using long polling. It can hang the request for at most 1 minute. It will return immediately if there are at least one new event. The server will only keep track the last 100 events (for the last 100 submissions and for the last 100 chat messages). Therefore if the client is not polling after a while, it may lose some events.

URL : http://uhunt.felix-halim.net/api/poll/{poll-id}.

The {poll-id} is the last id that is returned by the service. For the first call, you can use value 0 (zero) to get the last 100 events. After receiving the events, keep track of the latest "id" and use it to call the service again to get the next, etc. Note that currently the events are mixed between chat messages and submissions. I will clean this API later.

User Submissions

Returns all of the submissions of a particular user.

URL : http://uhunt.felix-halim.net/api/subs/{user-id}.

The {user-id} is the user id of the user. The service return a JSON formatted object with 3 attributes:

The subs array length is the same as the number of submissions of the user. Each element is one submission with values:

  1. Submission ID
  2. Problem ID
  3. Verdict ID
  4. Runtime
  5. Submission Time (unix timestamp)
  6. Language ID (1=ANSI C, 2=Java, 3=C++, 4=Pascal)
  7. Submission Rank

Verdict ID can be one of the following values:

Specific Users' Submissions on Specific Problems

Returns all the submissions of the users on specific problems.

URL : http://uhunt.felix-halim.net/api/subs-pids/{user-ids-csv}/{pids-csv}/{min-subs-id}.

The {user-ids-csv} is the user ids presented as comma-separated-values. Similarly, the {pids-csv} is the problem ids presented in comma-separated-values. The numbers in the both csvs are limited to 100 numbers. The {min-subs-id} is the minimum submission id to be returned (that is, to show all submissions set this value to zero, to see latest submissions, set it higher as appropriate).

The result is a hash map with the key is the user id and the value is the submissions of that user that associated with one of the specified problem ids. The format of the submissions is identical with the above description.

URL : http://uhunt.felix-halim.net/api/subs-nums/{user-ids-csv}/{nums-csv}/{min-subs-id}.

This is exactly the same as before, except that the problems is given in problem numbers, not problem ids.

Get The Bit-Encoded-Problem IDs that Has Been Solved by Some Authors

URL : http://uhunt.felix-halim.net/api/solved-bits/{user-ids-csv}.

Returns an array each contains: { uid:the-user-id, solved:[bit-encoded-solved-pids] }.

The bit-encoded-solved-pids is an array where the ith bit of the jth element (0-based) represents whether the particular user has solved the problem with pid = (j*32)+i.

Ranklist

Returns the user's ranklist and their neighbors.

URL : http://uhunt.felix-halim.net/api/ranklist/{user-id}/{nabove}/{nbelow}.

The {nabove} is the number of users above the {user-id} that you want to display. Similarly for the {nbelow}. Both {nabove} and {nbelow} is capped to 100. The result is a JSON formatted array where each element is a single user's rank with attributes:

What Else?

I'm planning to add more services like:

However, that's depend on my free time to implement them. If you don't find what you are looking for, you can contact me : felix.halim at gmail.




© Felix Halim 2011