How to get more results from the API

4 views
Skip to first unread message

Naveen

unread,
Apr 17, 2010, 2:16:06 PM4/17/10
to SiA-API
Hi,

The API returns 100 results by default.

But getbyinstitution method has a total of 326633 records. I tried
giving limit as this number but my code doesnt work.

Could you please let me know the procedure for getting all the data
from a method.

-Naveen


--
Subscription settings: http://groups.google.com/group/sia-api/subscribe?hl=en

Charlie Moad

unread,
Apr 18, 2010, 9:30:45 PM4/18/10
to sia...@googlegroups.com
     The Term::getByInstitution function has an optional "offset" parameter.  By default it is "0" and will give you the first 100 results.  Setting "offset" to 100 gives you result 101 to 200.  You can continue to increase this to get all the results.  You can also set the "limit" parameter to 1000 to get 1000 results at a time.  We recommend that you do not pull more than 1000 records in a single call to the api.

- Charlie

imamuseum.org made the following annotations
---------------------------------------------------------------------
From ordinary to extraordinary  | Tara Donovan: Untitled  | April 4-August 1 | Exhibition made possible by a grant from Eli Lilly and Company Foundation


---------------------------------------------------------------------



NOTICE:

Sat Apr 17 2010 14:16:14



This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited. If you are
not the intended recipient, please contact
---------------------------------------------------------------------


Naveen

unread,
Apr 19, 2010, 8:06:06 PM4/19/10
to SiA-API
Thanks Charlie.

I also thought of same thing. But the problem is the amount of data to
retrieve.

If i pull 1000 records at a time, i guess it will take a long time for
the code to pull all the data.

I am thinking of other alternatives. Please let me know if you can
think of anything else

-Naveen

On Apr 18, 9:30 pm, Charlie Moad <cm...@imamuseum.org> wrote:
>      The Term::getByInstitution function has an optional "offset" parameter.
>  By default it is "0" and will give you the first 100 results.  Setting
> "offset" to 100 gives you result 101 to 200.  You can continue to increase
> this to get all the results.  You can also set the "limit" parameter to 1000
> to get 1000 results at a time.  We recommend that you do not pull more than
> 1000 records in a single call to the api.
>
> - Charlie
>

Charlie Moad

unread,
Apr 20, 2010, 10:44:43 AM4/20/10
to sia...@googlegroups.com
     I just timed the retrieval of 1000 term records and it took 1.5 seconds.  A little math shows that you could pull all term records in a little under 10 minutes with a script.

- Charlie

IMA celebrates Earth Day with two great events  | Planet Indy talk with garden guru Felder Rushing | April 22 |  IMA Greenhouse's Perennial Premiere  | April 24-25


---------------------------------------------------------------------



NOTICE:

Mon Apr 19 2010 20:06:32




This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited. If you are
not the intended recipient, please contact the sender by reply email and
destroy all copies of the original message.
---------------------------------------------------------------------


Naveen

unread,
Apr 20, 2010, 10:48:05 AM4/20/10
to SiA-API
Okie. I will try with java code i have written to extract data and
place it into a database.

-Naveen

On Apr 20, 10:44 am, Charlie Moad <cm...@imamuseum.org> wrote:
>      I just timed the retrieval of 1000 term records and it took 1.5
> seconds.  A little math shows that you could pull all term records in a
> little under 10 minutes with a script.
>
> - Charlie
>
Reply all
Reply to author
Forward
0 new messages