News API - Miscellaneous

GET or POST

All endpoints support GET method. The /coverages and /related_stories endpoints support both GET and POST methods.

If you're dealing with long text, please consider using POST.

Query URL Encoding

Please remember to URL-encode your query. The following examples show how queries can be properly encoded.

Query URL-Encoded Query
published_at.start=NOW-30DAYS&categories.id[]=IAB1-5&entities.body.links.dbpedia[]=http://dbpedia.org/resource/Star_Wars&categories.taxonomy=iab-qag published_at.start=NOW-30DAYS&categories.id%5B%5D=IAB1-5&entities.body.links.dbpedia%5B%5D=http%3A%2F%2Fdbpedia.org%2Fresource%2FStar_Wars&categories.taxonomy=iab-qag
title=Trump OR Sanders&entities.title.text[]=election title=Trump+OR+Sanders&entities.title.text%5B%5D=election
title=Ireland&published_at.end=NOW-2MONTHS/DAY title=Ireland&published_at.end=NOW-2MONTHS%2FDAY

The space character can be represented by "%20" or the "+"-sign.

Maximum Input Size

Maximum Request URI size is 8 kB and body can't be larger than 8 MB or 414 (Request-URI Too Large) error is returned.

JSON or XML

By default the API returns JSON results. You can request results in JSON or XML formats for all of the endpoints.

To do so set Accept header to text/xml or application/json to change the format of your results.