Cannot find out what the "isHosted" key means in the JSON

66 views
Skip to first unread message

Chaitra S

unread,
Dec 19, 2016, 2:51:45 AM12/19/16
to Guardian Open Platform API Forum
hi,

I have been trying to get the contents of the news article for 

eg:

for the url:


i get the json response:

{
  "response": {
    "status": "ok",
    "userTier": "developer",
    "total": 24,
    "startIndex": 1,
    "pageSize": 10,
    "currentPage": 1,
    "pages": 3,
    "orderBy": "relevance",
    "results": [
      {
        "id": "tv-and-radio\/2014\/mar\/22\/tv-con-eastenders-itv-louis-theroux",
        "type": "article",
        "sectionId": "tv-and-radio",
        "sectionName": "Television & radio",
        "webPublicationDate": "2014-03-22T09:00:00Z",
        "webTitle": "On the trail of a con man",
        "webUrl": "https:\/\/www.theguardian.com\/tv-and-radio\/2014\/mar\/22\/tv-con-eastenders-itv-louis-theroux",
        "apiUrl": "https:\/\/content.guardianapis.com\/tv-and-radio\/2014\/mar\/22\/tv-con-eastenders-itv-louis-theroux",
        "isHosted": false
      },
      {
        "id": "business\/live\/2016\/nov\/24\/euro-low-german-slowdown-pound-italian-referendum-business-live",
        "type": "liveblog",
        "sectionId": "business",
        "sectionName": "Business",
        "webPublicationDate": "2016-11-24T16:56:11Z",
        "webTitle": "Fitch: Autumn statement shows fiscal challenge of Brexit vote \u2013 business live",
        "webUrl": "https:\/\/www.theguardian.com\/business\/live\/2016\/nov\/24\/euro-low-german-slowdown-pound-italian-referendum-business-live",
        "apiUrl": "https:\/\/content.guardianapis.com\/business\/live\/2016\/nov\/24\/euro-low-german-slowdown-pound-italian-referendum-business-live",
        "isHosted": false
      },
      {
        "id": "small-business-network\/2015\/apr\/17\/startup-day-job-own-business-entrepreneurs",
        "type": "article",
        "sectionId": "small-business-network",
        "sectionName": "Guardian Small Business Network",
        "webPublicationDate": "2015-04-17T06:00:07Z",
        "webTitle": "Workin' 9 to 5 to make a livin\u2026 and every other minute on your startup",
        "webUrl": "https:\/\/www.theguardian.com\/small-business-network\/2015\/apr\/17\/startup-day-job-own-business-entrepreneurs",
        "apiUrl": "https:\/\/content.guardianapis.com\/small-business-network\/2015\/apr\/17\/startup-day-job-own-business-entrepreneurs",
        "isHosted": false
      },
      {
        "id": "sustainable-business\/blog\/what-is-green-investment",
        "type": "article",
        "sectionId": "sustainable-business",
        "sectionName": "Guardian Sustainable Business",
        "webPublicationDate": "2011-09-07T14:25:48Z",
        "webTitle": "What are the priorities of a truly green investment?",
        "webUrl": "https:\/\/www.theguardian.com\/sustainable-business\/blog\/what-is-green-investment",
        "apiUrl": "https:\/\/content.guardianapis.com\/sustainable-business\/blog\/what-is-green-investment",
        "isHosted": false
      },
      {
        "id": "sustainable-business\/companies-hide-subsidiaries-tax-haven-christian-aid",
        "type": "article",
        "sectionId": "sustainable-business",
        "sectionName": "Guardian Sustainable Business",
        "webPublicationDate": "2014-05-13T11:49:39Z",
        "webTitle": "'Sustainable' companies hide behind subsidiaries in secretive tax havens",
        "webUrl": "https:\/\/www.theguardian.com\/sustainable-business\/companies-hide-subsidiaries-tax-haven-christian-aid",
        "apiUrl": "https:\/\/content.guardianapis.com\/sustainable-business\/companies-hide-subsidiaries-tax-haven-christian-aid",
        "isHosted": false
      },
      {
        "id": "us-news\/live\/2015\/nov\/26\/macys-thanksgiving-day-parade-new-york-live",
        "type": "liveblog",
        "sectionId": "us-news",
        "sectionName": "US news",
        "webPublicationDate": "2015-11-26T17:11:12Z",
        "webTitle": "Millions attend Macy's Thanksgiving Day parade in New York \u2013 as it happened",
        "webUrl": "https:\/\/www.theguardian.com\/us-news\/live\/2015\/nov\/26\/macys-thanksgiving-day-parade-new-york-live",
        "apiUrl": "https:\/\/content.guardianapis.com\/us-news\/live\/2015\/nov\/26\/macys-thanksgiving-day-parade-new-york-live",
        "isHosted": false
      },
      {
        "id": "lifeandstyle\/womens-blog\/2014\/feb\/14\/rape-culture-damage-it-does-everyday-sexism",
        "type": "article",
        "sectionId": "lifeandstyle",
        "sectionName": "Life and style",
        "webPublicationDate": "2014-02-14T12:42:20Z",
        "webTitle": "This is rape culture \u2013 and look at the damage it does",
        "webUrl": "https:\/\/www.theguardian.com\/lifeandstyle\/womens-blog\/2014\/feb\/14\/rape-culture-damage-it-does-everyday-sexism",
        "apiUrl": "https:\/\/content.guardianapis.com\/lifeandstyle\/womens-blog\/2014\/feb\/14\/rape-culture-damage-it-does-everyday-sexism",
        "isHosted": false
      },
      {
        "id": "world\/gallery\/2012\/aug\/29\/tomatina-festival-spain-in-pictures",
        "type": "gallery",
        "sectionId": "world",
        "sectionName": "World news",
        "webPublicationDate": "2012-08-29T15:05:00Z",
        "webTitle": "Tomatina festival in Spain - in pictures",
        "webUrl": "https:\/\/www.theguardian.com\/world\/gallery\/2012\/aug\/29\/tomatina-festival-spain-in-pictures",
        "apiUrl": "https:\/\/content.guardianapis.com\/world\/gallery\/2012\/aug\/29\/tomatina-festival-spain-in-pictures",
        "isHosted": false
      },
      {
        "id": "business\/marketforceslive\/2010\/feb\/16\/intercontinentalhotelsgroup-whitbread",
        "type": "article",
        "sectionId": "business",
        "sectionName": "Business",
        "webPublicationDate": "2010-02-16T10:01:34Z",
        "webTitle": "InterContinental Hotels unnerves market with cautious outlook",
        "webUrl": "https:\/\/www.theguardian.com\/business\/marketforceslive\/2010\/feb\/16\/intercontinentalhotelsgroup-whitbread",
        "apiUrl": "https:\/\/content.guardianapis.com\/business\/marketforceslive\/2010\/feb\/16\/intercontinentalhotelsgroup-whitbread",
        "isHosted": false
      },
      {
        "id": "business\/2007\/sep\/07\/5",
        "type": "article",
        "sectionId": "business",
        "sectionName": "Business",
        "webPublicationDate": "2007-09-06T23:14:51Z",
        "webTitle": "Buisness news in brief",
        "webUrl": "https:\/\/www.theguardian.com\/business\/2007\/sep\/07\/5",
        "apiUrl": "https:\/\/content.guardianapis.com\/business\/2007\/sep\/07\/5",
        "isHosted": false
      }
    ]
  }
}



Here the isHosted value is false does it mean you cannot get the content of the apiUrl? ,why are all the values false?, What should I do to
 get the content of the articles? .Any help is welcome.

Chaitra S

unread,
Dec 19, 2016, 4:44:45 AM12/19/16
to Guardian Open Platform API Forum
Read the solutions in one of the posts below,i had to add show-fields=all in the url

luke....@guardian.co.uk

unread,
Dec 20, 2016, 7:31:57 AM12/20/16
to Guardian Open Platform API Forum
Yes, Chaitra is correct. To see the body and fields of the article you need to add the query param ?show-fields=all. The isHosted field bears no relation to your problem.

Thanks.
Reply all
Reply to author
Forward
0 new messages