response output only shows first page?

20 views
Skip to first unread message

Sam Pham

unread,
May 30, 2019, 12:46:07 PM5/30/19
to Guardian Open Platform API Forum
hi team, i'm using R, "httr" to access your API and it seems like the response only has the first page?

library(httr)
tags  <- GET(url="https://content.guardianapis.com/tags",query = list(q="economics",'api-key'=apiKey))
tags  <- tags$content %>% rawToChar() %>% fromJSON()
tags  <- tags$response$results[,"id"]

many thanks for your help

best

sam

Mariot Chauvin

unread,
May 30, 2019, 12:51:19 PM5/30/19
to guardian...@googlegroups.com
See page, page-size parameter on page options on documentation

--
You received this message because you are subscribed to the Google Groups "Guardian Open Platform API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guardian-api-t...@googlegroups.com.
To post to this group, send email to guardian...@googlegroups.com.
Visit this group at https://groups.google.com/group/guardian-api-talk.
To view this discussion on the web, visit https://groups.google.com/d/msgid/guardian-api-talk/7beb85af-1515-4375-b76e-af153fcd5518%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



This e-mail and all attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender and delete the e-mail and all attachments immediately. Do not disclose the contents to another person. You may not use the information for any purpose, or store, or copy, it in any way.  Guardian News & Media Limited is not liable for any computer viruses or other material transmitted with or as part of this e-mail. You should employ virus checking software.
 
Guardian News & Media Limited is a member of Guardian Media Group plc. Registered Office: PO Box 68164, Kings Place, 90 York Way, London, N1P 2AP.  Registered in England Number 908396


Sam Pham

unread,
May 30, 2019, 1:02:02 PM5/30/19
to Guardian Open Platform API Forum
many thanks Mariot very clear. i have set page-size to 50 which i believe is the maximum. for queries that have more than 50 results, do i have to make 2 requests? one for the first 50, and so on...?
best,
sam


On Thursday, 30 May 2019 17:51:19 UTC+1, Mariot Chauvin wrote:
See page, page-size parameter on page options on documentation

On Thu, 30 May 2019 at 17:46, Sam Pham <thanh...@gmail.com> wrote:
hi team, i'm using R, "httr" to access your API and it seems like the response only has the first page?

library(httr)
tags  <- GET(url="https://content.guardianapis.com/tags",query = list(q="economics",'api-key'=apiKey))
tags  <- tags$content %>% rawToChar() %>% fromJSON()
tags  <- tags$response$results[,"id"]

many thanks for your help

best

sam

--
You received this message because you are subscribed to the Google Groups "Guardian Open Platform API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guardian...@googlegroups.com.

Mariot Chauvin

unread,
May 30, 2019, 1:17:29 PM5/30/19
to guardian...@googlegroups.com
Le jeu. 30 mai 2019 à 18:02, Sam Pham <thanh...@gmail.com> a écrit :
many thanks Mariot very clear. i have set page-size to 50 which i believe is the maximum. for queries that have more than 50 results, do i have to make 2 requests? one for the first 50, and so on...?

Indeed

To unsubscribe from this group and stop receiving emails from it, send an email to guardian-api-t...@googlegroups.com.

To post to this group, send email to guardian...@googlegroups.com.
Visit this group at https://groups.google.com/group/guardian-api-talk.

For more options, visit https://groups.google.com/d/optout.
--

Mariot Chauvin

Head of Engineering - Digital

Guardian News & Media

-----

+44 7936636308

EA: rasha....@guardian.co.uk

Reply all
Reply to author
Forward
0 new messages