retrieve datasets with API

57 views
Skip to first unread message

Lekan Anifowoshe

unread,
Sep 6, 2017, 4:22:54 AM9/6/17
to Dataverse Users Community
Hello everyone,

I am trying to retrieve all datasets from this url link https://dataverse.harvard.edu/dataverse/Africa. Can anyone tell me how to call these datatsets through API ?

Thank you.

Regards,
Lekan

Don Sizemore

unread,
Sep 6, 2017, 6:55:33 AM9/6/17
to dataverse...@googlegroups.com
Hello,

You can call any published/public object through the Dataverse API, given its ID. For Dataverses, the $id may also be an alias (in this case Africa), and this API endpoint in particular will return all objects within a dataverse:
GET http://$SERVER/api/dataverses/$id/contents
However, https://dataverse.harvard.edu/dataverse/Africa returns a 404 for me?

If it helps, here's a script I wrote to download all files in original format from a given dataset.
https://github.com/donsizemore/odum/blob/master/dataverse/download_dataset_original_format.py

Others on the list can certainly give you a smarter answer than I, but that's what I can offer.

Donald


--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/c8e7ec5b-0d82-4d19-be12-88675a073ece%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Philip Durbin

unread,
Sep 6, 2017, 7:01:53 AM9/6/17
to dataverse...@googlegroups.com
The only caveat about using the "contents" API is that it can time out[1] on large lists of datasets. Definitely worth a try, like Don said.

You could try the "List datasets in a dataverse" endpoint of the SWORD API: http://guides.dataverse.org/en/4.7.1/api/sword.html#list-datasets-in-a-dataverse

There's an undocumented “MyData” API you could try: https://github.com/IQSS/dataverse/issues/1299#issuecomment-255547345

Once the "Africa" dataverse has been published, you could try the Search API to list datasets, narrowing down by "subtree": http://guides.dataverse.org/en/4.7.1/api/search.html

I hope this helps,

Phil

1. https://github.com/IQSS/dataverse/issues/2122


On Wed, Sep 6, 2017 at 6:55 AM, Don Sizemore <don.si...@gmail.com> wrote:
Hello,

You can call any published/public object through the Dataverse API, given its ID. For Dataverses, the $id may also be an alias (in this case Africa), and this API endpoint in particular will return all objects within a dataverse:
GET http://$SERVER/api/dataverses/$id/contents
However, https://dataverse.harvard.edu/dataverse/Africa returns a 404 for me?

If it helps, here's a script I wrote to download all files in original format from a given dataset.
https://github.com/donsizemore/odum/blob/master/dataverse/download_dataset_original_format.py

Others on the list can certainly give you a smarter answer than I, but that's what I can offer.

Donald

On Wed, Sep 6, 2017 at 4:22 AM, Lekan Anifowoshe <anney...@gmail.com> wrote:
Hello everyone,

I am trying to retrieve all datasets from this url link https://dataverse.harvard.edu/dataverse/Africa. Can anyone tell me how to call these datatsets through API ?

Thank you.

Regards,
Lekan

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages