trying to build url for json

43 views
Skip to first unread message

adeibiza

unread,
Dec 6, 2011, 10:07:38 AM12/6/11
to Guardian API Talk
the main sections i can get but when trying to delve deeper its not so
obvious

eg

album reviews is fine:
http://content.guardianapis.com/search?section=tone%2Falbumreview&format=json&show-fields=all&order-by=newest&api-key=

but cant seem to work out how to get rockandpop live music reviews ?

eg i would've thought this would work:

http://content.guardianapis.com/search?section=popandrock%2Btone%2Flivemusicreview&format=json&show-fields=all&order-by=newest&api-key=

Michael Brunton-Spall

unread,
Dec 6, 2011, 10:57:21 AM12/6/11
to guardian...@googlegroups.com
I'm assuming that you are looking for is this webpage on the guardian: http://www.guardian.co.uk/music/popandrock+tone/livemusicreview

The key here is that popandrock is a tag within the music section.  So it needs to be prefixed with the section, i.e. music/popandrock.

You want any content that has both tags, music/popandrock and tone/livemusicreview which you can do with our boolean expressions for tags, so music/popandrock,tone/livemusicreview.

Finally in your samples you were specifying a section filter not a tag filter.  A section filter is designed to restrict to say the music section rather than an individual tag, so use the tag filter like so:

That url takes you to our explorer, the easiest way of figuring out our api because of it's easy experimentation features.


I hope that helps.

Michael Brunton-Spall
guardian.co.uk



--
You received this message because you are subscribed to the Google Groups "Guardian API Talk" group.
To post to this group, send an email to guardian...@googlegroups.com.
To unsubscribe from this group, send email to guardian-api-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/guardian-api-talk?hl=en-GB.


adeibiza

unread,
Dec 6, 2011, 11:03:04 AM12/6/11
to Guardian API Talk
aha ! thanks a bunch - i only started on it yesterday - tend to rush
in and not RTFM ;)

On Dec 6, 4:57 pm, Michael Brunton-Spall <mich...@brunton-spall.co.uk>
wrote:


> I'm assuming that you are looking for is this webpage on the guardian:http://www.guardian.co.uk/music/popandrock+tone/livemusicreview
>
> The key here is that popandrock is a tag within the music section.  So it
> needs to be prefixed with the section, i.e. music/popandrock.
>
> You want any content that has both tags, music/popandrock and
> tone/livemusicreview which you can do with our boolean expressions for
> tags, so music/popandrock,tone/livemusicreview.
>
> Finally in your samples you were specifying a section filter not a tag
> filter.  A section filter is designed to restrict to say the music section

> rather than an individual tag, so use the tag filter like so:http://explorer.content.guardianapis.com/#/search?format=json&show-fi...


>
> That url takes you to our explorer, the easiest way of figuring out our api
> because of it's easy experimentation features.
>

> For direct access to the JSON you can just go to:http://content.guardianapis.com/search?format=json&show-fields=all&id...


>
> I hope that helps.
>
> Michael Brunton-Spall
> guardian.co.uk
>

> On 6 December 2011 15:07, adeibiza <adeib...@gmail.com> wrote:
>
>
>
>
>
>
>
> > the main sections i can get but when trying to delve deeper its not so
> > obvious
>
> > eg
>
> > album reviews is fine:
>

> >http://content.guardianapis.com/search?section=tone%2Falbumreview&for...


>
> > but cant seem to work out how to get rockandpop live music reviews ?
>
> > eg i would've thought this would work:
>

> >http://content.guardianapis.com/search?section=popandrock%2Btone%2Fli...

Reply all
Reply to author
Forward
0 new messages