You use the ListRecords verb to harvest records from a repository.
Let’s see an example request. To start we need to go to the “base” URL:
http://[ServerUrl]/oai/data/oai2_0
Now we specify the verb — which in this case is ListRecords. So add ?verb= ListRecords to the end of the previous URL to get this:
http://[ServerUrl]/oai/data/oai2_0?verb=ListRecords
Here’s an example response:
Scroll to the end of the page and you’ll see the resumptionToken argument, for example:
You can use this token to go to the next page.
completeListSize shows how many records there are in total. There are 555,906 in this example.
cursor shows which record is the first on the current page, e.g. in the example above the cursor is 0 — i.e. we’re on the first page.
By default we show 20 records per page — that’s the “20” you see at the end.
9073|278452|20
The second number is the IRN of the last record on the page — e.g. IRN 278452 in this example. So here the resumptionToken is:
<resumptionToken completeListSize="555906" cursor="0">9073|278452|20</resumptionToken>
So add this resumptionToken &resumptiontoken=9073|278452|20 to the end of our URL to get this:
http://[ServerUrl]/oai/data/oai2_0?verb=ListRecords&resumptiontoken=9073|278452|20
Here’s an example response:
You can use the metadataPrefix argument to specify the format of the records you want. There are three options for the metadataPrefix:
We only support marc21 at the moment. The oai_dc is for Dublin Core — that’s something we’ll support in a future release.
We can include the metadataPrefix in the URL. Like this:
http://[ServerUrl]/oai/data/oai2_0?verb=ListRecords&metadataPrefix=marc21
You can use the from and/or the until argument to specify the last updated date for the records you want.
Let’s try listing the records last updated on 1 March 2016 or later:
&from=2016-03-01
So add this to the end of the URL to get this:
http://[ServerUrl]/oai/data/oai2_0?verb=ListRecords&from=2016-03-01
Let’s add an until argument. Let’s leave from=2016-03-01 and set until=2016-03-31. So now the URL looks like this:
http://[ServerUrl]/oai/data/oai2_0?verb=ListRecords&from=2016-03-01&until=2016-03-31
You can use the set argument to specify the set of records you want. In this example we'll use a global SavedList.
First create a global SavedList.
Then add this global SavedList to the list of available "sets" using the OAI Set Editor.
Now add the name of the global SavedList to the end of the URL, for example:
http://[ServerUrl]/oai/data/oai2_0?verb=ListRecords&set=SVL:MYSAVEDLIST