Search code examples
apiguardian

Get all articles Guardian API


I used guardian news api to fetch data. Then it documentation said, results are returned as paginated list of containing, by default, 10 entries per page. And I get output JSON as this. guardian documentation can find here

{
    "response": {
        "status": "ok",
        "userTier": "developer",
        "total": 8174,
        "startIndex": 1,
        "pageSize": 10,
        "currentPage": 1,
        "pages": 818,
        "orderBy": "relevance",
        "results": []
}

I want to colect all data(total of 8174 in example) instace of 10 entities. Is there any way to fetch all data ?


Solution

  • I found the answer. Default guardian fetches 10 entries per page. We can override default values using page-size parameter in API and providing needed data count.

    https://content.guardianapis.com/search?q={query}&page-size={data count}