Beginner: Correct query and limited returns

73 views
Skip to first unread message

oscar...@gmail.com

unread,
Oct 28, 2020, 3:45:28 AM10/28/20
to Europeana API forum

Dear all,

I have limited knowledge of working with the Europeana API, but I am looking to query all works that have the word theatre (or alternate spellings in different languages; e.g. theatrum, theatro, etc.) in their title. For this, I have created a query and my question is:


1) Is the query correct; and how can I add the additional search terms?
2) How can I return all results? At the moment, I can only see max 10 items.

Many thanks in advance!

Oscar


Jolan Wuyts

unread,
Oct 28, 2020, 8:21:19 AM10/28/20
to Europeana API forum
Hiya Oscar!

Thanks for reaching out. Here are some tips to improve your query. 

- to see more than ten items, change the rows parameter, it is set to 12 by default. The maximum amount of objects you can return in a single call is 100, by using rows=100. If you want to see the next 100 results, you can change paginate through your results by using the page parameter, so to see the next page you would use page=2. example query: https://www.europeana.eu/api/v2/search.json?languageCodes=nl,en,lat,ger,fr,it&wskey=APIKEY&query=what:text&qf=title:%22theatrum%22&rows=100&page=1

- are you only trying to get textual objects? If so, instead of using what:text in the q= field, it would be better to use TYPE=text. the what parameter queries a few different fields at the same time, which may be restricting your search results. example query: https://www.europeana.eu/api/v2/search.json?languageCodes=nl,en,lat,ger,fr,it&wskey=APIKEY&query=title:theatre&qf=TYPE:TEXT&rows=100&page=1

- it seems like you're trying to use the languageCodes parameter in the search.json method, which doesn't work. To get translated terms to search with, you must call on the translateQuery method first with the term you want translated. to translate theatre to the languages you specified, the call would look like this: https://www.europeana.eu/api/v2/translateQuery.json?wskey=APIKEY&term=theatre&languageCodes=nl,en,lat,ger,fr,it
you can then use the translated terms you received from this method, like Théâtre and Teatro, in your search.json method. e.g. https://www.europeana.eu/api/v2/search.json?&wskey=APIKEY&query=title:(theatre%20OR%20teatro%20OR%20Th%C3%A9%C3%A2tre%20OR%20teatre%20OR%20teater%20OR%20theater)&qf=TYPE:TEXT&rows=100&page=1 

I hope this helps! If you have any more questions, don't hesitate to ask. 

Best

Jolan

oscar...@gmail.com

unread,
Oct 28, 2020, 9:22:28 AM10/28/20
to Europeana API forum
Dear Jolan,

Thank you very much! That is incredibly useful. I'll start playing around with and let you know if I have any more questions.

Many thanks again,

Oscar

Op woensdag 28 oktober 2020 om 13:21:19 UTC+1 schreef jolan...@europeana.eu:
Reply all
Reply to author
Forward
0 new messages