Getting number of articles for certain country

16 views
Skip to first unread message

Lucas Rodes

unread,
May 7, 2024, 5:03:59 AMMay 7
to Guardian Open Platform API Forum
Hi, I am exploring this data to get something like "number of news for a year and country".

I've seen there are tags like "world/france", "world/germany", etc. So an option would be to run a query like: https://content.guardianapis.com/search?tag=world/spain and check the response.total value.

This leads me to two questions:
  1. Is there a way to obtain the list of possible "world/*"-like tags? This way I'd iterate over this list and get the number of articles for each tag (i.e. country)
  2. I've seen that there are other tags like 'weather/spain' or 'football/spain'. Is there a way to link all these tags under the umbrella "spain"? 
    • If not, would it safe to assume the following: For each 'world/<country-name>' there might be a set of '<category>/<country-name>' (e.g. 'weather/NAME') tags. That is, the category changes but the country name remains the same. If that were the case, I could check across all the different categories (list[<category>]) if there is an equivalent for the country in that category.
    • However, is there a way to obtain this list of different categories (i.e. 'world', 'weather', 'football', etc.)?

Thank you very much!

Reply all
Reply to author
Forward
0 new messages