Request json at Guardian API

Share:

Description

The function get_json makes a call at Guardian API to retrieve articles that match the criteria. The function is called by get_guardian and should not be used standalone.

Usage

1
get_json(keywords, section, format, from.date, to.date, api.key)

Arguments

keywords

Keyword to search Guardian API. Exemple: "Thatcher". For multiple keywords use "Margaret+Hilda+Thatcher".

section

Specifies news sections to narrow the query (articles from other news desks will be filtered out). It doesn not accept blank spaces, so use "word" if querying for articles in the "World news" section (and so on). It defaults to NULL in which case API search is performed across all sections.

format

Specifies format JSON or XML formar. It defaults to JSON.

from.date

Start date of search.

to.date

End date of search.

api.key

Guardian API-key.

Author(s)

Marco Bastos & Cornelius Puschmann