Headlines / Top Stories

405 views
Skip to first unread message

James Bridle

unread,
Mar 2, 2015, 9:58:28 AM3/2/15
to guardian...@googlegroups.com
I'm trying to use the open platform to get a list of the top headlines.

This old blog post on the Open Platform blog suggests this should be possible: http://www.theguardian.com/open-platform/blog/new-api-features-video-editors-picks-endpoint-filters-homepage-gzip

But none of those links work any more. In fact I can't get the editors-picks to return anything anywhere.


Just gives me:

{
  • -
    response: {
    • status"ok"
    • userTier"developer"
    • total1
    • editorsPicks: [ ]
    }
}

For example.

I just want to be able to make a call and get the headlines - not the most recent stories, but the ones that are most important. Seems like this should be easier than I'm finding it?

Thanks for your help.

James

James Bridle

unread,
Mar 2, 2015, 10:02:50 AM3/2/15
to guardian...@googlegroups.com
To clarify - I want the top news headlines on the site, not in the sport section - i.e. what you see on the front page.

Mariot Chauvin

unread,
Mar 2, 2015, 10:05:48 AM3/2/15
to guardian...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Guardian API Talk" 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 http://groups.google.com/group/guardian-api-talk.
For more options, visit https://groups.google.com/d/optout.



Visit theguardian.com. On your mobile and tablet, download the Guardian iPhone and Android apps theguardian.com/guardianapp and our tablet editions theguardian.com/editions.  Save up to 57% by subscribing to the Guardian and Observer - choose the papers you want and get full digital access.  Visit subscribe.theguardian.com

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


James Bridle

unread,
Mar 2, 2015, 2:01:33 PM3/2/15
to guardian...@googlegroups.com
Thanks for the swift response on this. That does work, although it's a bit broad in what it returns (I don't want liveblogs, for example, or sport...). I've been trying to narrow it down, but what I get back is a bit confusing.

I'm trying to concentrate on World and UK news, so I tried calling by section:


This returns only the front-page headlines from the World section (rather, than as I expected, the top stories on http://www.theguardian.com/world)


This returns stories from http://www.theguardian.com/world but inconsistently. 

At time of writing, the top story on /world (http://www.theguardian.com/world/2015/mar/02/iraq-assault-islamic-state-strongholds-baghdad) isn't part of the main results or editors picks?

I really appreciate your help, thanks.

Mariot Chauvin

unread,
Mar 3, 2015, 11:26:24 AM3/3/15
to guardian...@googlegroups.com
Hi James,

Please see comments below

On 2 March 2015 at 19:01, James Bridle <james...@gmail.com> wrote:
Thanks for the swift response on this. That does work, although it's a bit broad in what it returns (I don't want liveblogs, for example, or sport...). I've been trying to narrow it down, but what I get back is a bit confusing.

I'm trying to concentrate on World and UK news, so I tried calling by section:


This returns only the front-page headlines from the World section (rather, than as I expected, the top stories on http://www.theguardian.com/world)




 

This returns stories from http://www.theguardian.com/world but inconsistently. 

At time of writing, the top story on /world (http://www.theguardian.com/world/2015/mar/02/iraq-assault-islamic-state-strongholds-baghdad) isn't part of the main results or editors picks?

I really appreciate your help, thanks.


I did a quick test just now (4.15 pm BST)

"editorsPicks": [{"webTitle": "Israeli prime minister Binyamin Netanyahu addresses Congress – live","webPublicationDate": "2015-03-03T16:08:01Z","sectionId": "world","id": "world/live/2015/mar/03/israeli-prime-minister-benyamin-netanyahu-address-congress-live","webUrl": "http://www.theguardian.com/world/live/2015/mar/03/israeli-prime-minister-benyamin-netanyahu-address-congress-live","apiUrl": "http://content.guardianapis.com/world/live/2015/mar/03/israeli-prime-minister-benyamin-netanyahu-address-congress-live","sectionName": "World news"},{"webTitle": "Afghanistan officials sanctioned murder, torture and rape, says report","webPublicationDate": "2015-03-03T14:31:46Z","sectionId": "world","id": "world/2015/mar/03/afghanistan-allies-sanctioned-torture-murder-report-human-rights-watch","webUrl": "http://www.theguardian.com/world/2015/mar/03/afghanistan-allies-sanctioned-torture-murder-report-human-rights-watch","apiUrl": "http://content.guardianapis.com/world/2015/mar/03/afghanistan-allies-sanctioned-torture-murder-report-human-rights-watch","sectionName": "World news"},{"id": "world/2015/mar/03/boris-nemtsov-funeral-queue-moscow-coffin","sectionId": "world","webPublicationDate": "2015-03-03T13:25:24Z","webTitle": "Boris Nemtsov's funeral takes place in Moscow as EU condemns travel bans","webUrl": "http://www.theguardian.com/world/2015/mar/03/boris-nemtsov-funeral-queue-moscow-coffin","apiUrl": "http://content.guardianapis.com/world/2015/mar/03/boris-nemtsov-funeral-queue-moscow-coffin","sectionName": "World news"},{"webTitle": "Volcano erupts in southern Chile","webPublicationDate": "2015-03-03T13:10:49Z","sectionId": "world","id": "world/2015/mar/03/volcano-villarrica-erupts-southern-chile","webUrl": "http://www.theguardian.com/world/2015/mar/03/volcano-villarrica-erupts-southern-chile","apiUrl": "http://content.guardianapis.com/world/2015/mar/03/volcano-villarrica-erupts-southern-chile","sectionName": "World news"},{"id": "us-news/2015/mar/02/georgia-death-row-woman-executed-monday","sectionId": "us-news","webPublicationDate": "2015-03-02T17:24:19Z","webTitle": "Georgia death row woman in last-ditch bid for clemency as execution looms","webUrl": "http://www.theguardian.com/us-news/2015/mar/02/georgia-death-row-woman-executed-monday","apiUrl": "http://content.guardianapis.com/us-news/2015/mar/02/georgia-death-row-woman-executed-monday","sectionName": "US news"},{"id": "us-news/2015/mar/03/hillary-clinton-used-personal-email-account-for-all-government-business-report-claims","sectionId": "us-news","webPublicationDate": "2015-03-03T13:31:45Z","webTitle": "Hillary Clinton used personal email for all government business, says report","webUrl": "http://www.theguardian.com/us-news/2015/mar/03/hillary-clinton-used-personal-email-account-for-all-government-business-report-claims","apiUrl": "http://content.guardianapis.com/us-news/2015/mar/03/hillary-clinton-used-personal-email-account-for-all-government-business-report-claims","sectionName": "US news"},{"webTitle": "Suge Knight tells LA court he is going blind","webPublicationDate": "2015-03-03T09:17:37Z","sectionId": "music","id": "music/2015/mar/03/suge-knight-tells-la-court-he-is-going-blind","webUrl": "http://www.theguardian.com/music/2015/mar/03/suge-knight-tells-la-court-he-is-going-blind","apiUrl": "http://content.guardianapis.com/music/2015/mar/03/suge-knight-tells-la-court-he-is-going-blind","sectionName": "Music"},{"webTitle": "Three to five cups of coffee a day may prevent heart attacks, says study","webPublicationDate": "2015-03-03T08:54:32Z","sectionId": "society","id": "society/2015/mar/03/coffee-drinking-may-prevent-heart-attacks-study","webUrl": "http://www.theguardian.com/society/2015/mar/03/coffee-drinking-may-prevent-heart-attacks-study","apiUrl": "http://content.guardianapis.com/society/2015/mar/03/coffee-drinking-may-prevent-heart-attacks-study","sectionName": "Society"},{"webTitle": "Parisians carry on shopping as mass graves are exhumed below their feet","webPublicationDate": "2015-03-02T18:24:05Z","sectionId": "world","id": "world/2015/mar/02/paris-mass-graves-skeletons-monoprix-store-hospital","webUrl": "http://www.theguardian.com/world/2015/mar/02/paris-mass-graves-skeletons-monoprix-store-hospital","apiUrl": "http://content.guardianapis.com/world/2015/mar/02/paris-mass-graves-skeletons-monoprix-store-hospital","sectionName": "World news"},{"webTitle": "China investigates second top soldier in corruption probe into armed forces","webPublicationDate": "2015-03-03T13:20:36Z","sectionId": "world","id": "world/2015/mar/03/china-investigates-second-top-soldier-corruption-guo-boxiong-zhenggang-xu-caihou","webUrl": "http://www.theguardian.com/world/2015/mar/03/china-investigates-second-top-soldier-corruption-guo-boxiong-zhenggang-xu-caihou","apiUrl": "http://content.guardianapis.com/world/2015/mar/03/china-investigates-second-top-soldier-corruption-guo-boxiong-zhenggang-xu-caihou","sectionName": "World news"},{"webTitle": "FBI investigating hack of naked photos of Jennifer Lawrence and others","webPublicationDate": "2014-09-02T11:24:51Z","sectionId": "technology","id": "technology/2014/sep/02/fbi-investigating-hack-nude-celebrity-leak","webUrl": "http://www.theguardian.com/technology/2014/sep/02/fbi-investigating-hack-nude-celebrity-leak","apiUrl": "http://content.guardianapis.com/technology/2014/sep/02/fbi-investigating-hack-nude-celebrity-leak","sectionName": "Technology"},
 





It looks consistent to me. I see 2 obvious reasons that could explain temporary inconsistencies you observe:
  • you receive a cache version from our CDN of the webpage (several minutes max)
  • you receive a cache version from mashery of the API response (20 seconds max) 
Anyway whatever the reason you should consider the API response at the most up to date editor picks for a particular section.

Hope this helps.

James Bridle

unread,
Mar 4, 2015, 6:19:34 AM3/4/15
to guardian...@googlegroups.com
That all makes sense. /world with section=world looks like the closest to what I want to achieve. Thanks for your help.
...

Karen Jung

unread,
Jul 9, 2016, 7:11:28 PM7/9/16
to Guardian Open Platform API Forum
Hi James,

Did you use Python for this? Is there any way to just display all the headlines without all the other junk surrounding it ?

Thank you,

Karen


On Monday, March 2, 2015 at 2:58:28 PM UTC, James Bridle wrote:
Reply all
Reply to author
Forward
0 new messages