RADAR Overview

Content API

RADAR is a product that sits within the Content API.

Before starting on this documentation it would be useful to familarise yourself with the general documentation of Content API. This can be found here.

Details for how to add Authentication to API call can be found here.

Selecting the RADAR product

Description

Reports And Data and Robots (RADAR) harnesses the power of technology to deliver incisive, fact-based news stories to local media across the UK and Ireland. RADAR uses Natural Language Generation (NLG) software to create stories from public data sets, which are then made available to local news organisations around the country.

API Example

curl \
  -H "Accept: application/json" \
  -H "apikey: <API KEY>" \
  https://content.api.pressassociation.io/v1/item?product=paproduct:radar

Content types

TypeProfileExamples
storytextStory - Text

📘

The full documentation for selecting products in Content API can be found here

Schema

JSON Responses from the Content API use a PA variant of the IPTC Ninjs schema.

The IPTC hub for Ninjs can be found here - https://iptc.org/standards/ninjs/

The PA Varient Schema can be found here

Story Text Responses

RADAR stories are modelled as 'Story Text' posts, which are documented in full here.

However RADAR stories have additional renditions, such as pictures, graphics & source data which isn't detailed on that page.

Pictures & Graphics

Pictures associated with the story can be attached to a RADAR story by being referenced in the associations map.

Example

"associations": {
  "associated1": {
    "uri": "2.50321118",
    "type": "picture",
    "copyrightholder": "PA Wire",
    "copyrightnotice": "PA Wire/PA Images",
    "usageterms": "FILE PHOTO",
    "renditions": {
      "original": {
        "href": "https://image.assets.pressassociation.io/v2/image/production/252e8d4016b861024aa6ecc0ec76a3edY29udGVudHNlYXJjaCwxNTkwMDU4NTg3/2.50321118.jpg",
        "height": 1390,
        "width": 2135
        }
      },
      "description_credit": "Andrew Matthews"
    }
  }
}

📘

Graphics will render as the same as the above example, but the type field will be set to 'graphic'

Source Data

Source data can be attached to a RADAR story by being referenced in the rendittions map.

Example

"renditions": {
  "sourcedata1": {
    "href": "https://www.gov.uk/government/statistics/personal-independence-payment-april-2013-to-january-2020"
  }
}

Entitled Places

Content API keys are restricted by a users entitlements. For RADAR a user is assigned entitlements based on place codes. The place endpoint can be queried to find the list of keys that a

Request

curl \
  -H "Accept: application/json" \
  -H "apikey: <API KEY>" \
  https://content.api.pressassociation.io/v1/place?product=paproduct:radar

Response

{
  "total": 4,
  "limit": 20,
  "offset": 0,
  "item": [
    {
      "uri": "local-authority:ons:E07000223",
      "profile": "local-authority",
      "version": "1",
      "firstcreated": "2018-05-09T09:57:01Z",
      "versioncreated": "2018-05-09T09:57:01Z",
      "pubstatus": "usable",
      "place": [
        {
          "code": "local-authority:ons:E07000223",
          "name": "Adur",
          "profile": "local-authority",
          "scheme": "http://geoportal.statistics.gov.uk/datasets/a267b55f601a4319a9955b0197e3cb81_0",
          "rel": "self"
        }
      ],
      "description_text": "Adur",
      "links": [
        {
          "rel": "self",
          "href": "https://content.api.pressassociation.io/v1/place/local-authority:ons:E07000223"
        },
        {
          "rel": "item-collection",
          "href": "https://content.api.pressassociation.io/v1/place/local-authority:ons:E07000223/item"
        }
      ]
    },
    {
      "uri": "local-authority:ons:E07000240",
      "profile": "local-authority",
      "version": "1",
      "firstcreated": "2018-05-09T09:57:35Z",
      "versioncreated": "2018-05-09T09:57:35Z",
      "pubstatus": "usable",
      "place": [
        {
          "code": "local-authority:ons:E07000240",
          "name": "St Albans",
          "profile": "local-authority",
          "scheme": "http://geoportal.statistics.gov.uk/datasets/a267b55f601a4319a9955b0197e3cb81_0",
          "rel": "self"
        }
      ],
      "description_text": "St Albans",
      "links": [
        {
          "rel": "self",
          "href": "https://content.api.pressassociation.io/v1/place/local-authority:ons:E07000240"
        },
        {
          "rel": "item-collection",
          "href": "https://content.api.pressassociation.io/v1/place/local-authority:ons:E07000240/item"
        }
      ]
    },
    {
      "uri": "local-authority:ons:E07000026",
      "profile": "local-authority",
      "version": "1",
      "firstcreated": "2018-05-09T09:57:01Z",
      "versioncreated": "2018-05-09T09:57:01Z",
      "pubstatus": "usable",
      "place": [
        {
          "code": "local-authority:ons:E07000026",
          "name": "Allerdale",
          "profile": "local-authority",
          "scheme": "http://geoportal.statistics.gov.uk/datasets/a267b55f601a4319a9955b0197e3cb81_0",
          "rel": "self"
        }
      ],
      "description_text": "Allerdale",
      "links": [
        {
          "rel": "self",
          "href": "https://content.api.pressassociation.io/v1/place/local-authority:ons:E07000026"
        },
        {
          "rel": "item-collection",
          "href": "https://content.api.pressassociation.io/v1/place/local-authority:ons:E07000026/item"
        }
      ]
    },
    {
      "uri": "local-authority:ons:S12000035",
      "profile": "local-authority",
      "version": "1",
      "firstcreated": "2018-05-09T09:57:02Z",
      "versioncreated": "2018-05-09T09:57:02Z",
      "pubstatus": "usable",
      "place": [
        {
          "code": "local-authority:ons:S12000035",
          "name": "Argyll and Bute",
          "profile": "local-authority",
          "scheme": "http://geoportal.statistics.gov.uk/datasets/a267b55f601a4319a9955b0197e3cb81_0",
          "rel": "self"
        }
      ],
      "description_text": "Argyll and Bute",
      "links": [
        {
          "rel": "self",
          "href": "https://content.api.pressassociation.io/v1/place/local-authority:ons:S12000035"
        },
        {
          "rel": "item-collection",
          "href": "https://content.api.pressassociation.io/v1/place/local-authority:ons:S12000035/item"
        }
      ]
    }
  ],
  "links": [
    {
      "rel": "self",
      "href": "https://content.api.pressassociation.io/v1/place"
    }
  ]
}

Stories by Place

Content API can be queries to return the list of RADAR stories for a specific place.

To do this, you need to pass the uri code from an entry to the place parameter on the item endpoint.

Request

curl \
  -H "Accept: application/json" \
  -H "apikey: <API KEY>" \
  https://content.api.pressassociation.io/v1/item?product=paproduct:radar&place=local-authority:ons:E07000223

Response

{
    "total": 2,
    "limit": 20,
    "offset": 0,
    "item": [
        {
            "uri": "ece9e032-9d38-4fbe-b256-881574b9c26e",
            "type": "text",
            "profile": "story",
            "version": "3",
            "firstcreated": "2020-05-20T10:30:45Z",
            "versioncreated": "2020-05-20T10:57:09Z",
            "issued": "2020-05-20T10:30:45Z",
            "urgency": 4,
            "pubstatus": "usable",
            "language": "en",
            "byline": "Joseph Hook, data reporter",
            "headline": "Adur house prices  increased more than across the South East in  March",
            "description_shortheadline": "House Prices, March 2020",
            "description_text": "House prices increased more than average for the South East in Adur in March, new figures show.",
            "description_html": "<p>House prices increased more than average for the South East in Adur in March, new figures show.</p>",
            "body_text": "House prices increased more than average for the South East in Adur in March, new figures show.\n\n The  boost  contributes to the longer-term trend, which has seen property prices in the area  achieve 2.6% annual growth .\n\nThe average Adur house price in March was £314,710, Land Registry figures show  – a 1.3% increase on February.\n\nOver the month, the picture was  better than that across the South East, where prices  increased 0.6% , and Adur outperformed the 0.2% drop for the UK as a whole.\n\nOver the last year, the average sale price of property in Adur   rose by £8,100 – putting the  area 18th among the South East’s 67 local authorities for annual growth.\n\n The best annual growth in the region was in Gravesham, where properties increased on average by 14.6%, to £321,000.  At the other end of the scale, properties in Chiltern dropped 5.7% in value, giving an average price of £527,000.\n\n\n\nWinners and Losers\n\nOwners of semi-detached houses saw the biggest improvement in property prices in Adur in March – they increased 1.6%, to £355,821 on average. Over the last year, prices rose by 3.6%.\n\nAmong other types of property: \n\nDetached: up 1.5% monthly; up 2.6% annually; £484,516 averageTerraced: up 1.1% monthly; up 3.2% annually; £300,590 averageFlats: up 0.9% monthly; up 0.8% annually; £194,520 average\n\n \n\nFirst steps on the property ladder\n\nFirst-time buyers in Adur spent an average of £ 265,300 on their property –  £6,000 more than a year ago,  and  £46,000 more than in March 2015.\n\nBy comparison, former owner-occupiers paid £ 348,100 on average in March  – 31.2% more than first-time buyers.\n\n \n\nHow do property prices in Adur compare?\n\n \n\nBuyers paid 2.7% less than the average price in the South East (£323,000) in March for a property in Adur. Across the South East, property prices are high compared to those across the UK, where the average cost £232,000.\n\nThe most expensive properties in the South East were in South Bucks – £595,000 on average, and 1.9 times as much as in Adur. South Bucks properties cost three times as much as homes in Southampton (£200,000 average), at the other end of the scale.\n\nThe highest property prices across the UK were in Kensington and Chelsea, where the average March sale price of £1.4 million could buy 16 properties in Burnley (average £86,000).\n\n\n\n\n\n\n\nFactfile\n\nAverage property price in March\n\nAdur: £314,710The South East: £323,353UK: £231,855Annual growth to March\n\nAdur: +2.6%The South East: +2.0%UK: +2.1%Best and worst annual growth in the South East\n\nGravesham: +14.6%Chiltern: -5.7%",
            "body_html": "<p>House prices increased more than average for the South East in Adur in March, new figures show.</p><p>​The ​boost ​contributes to the longer-term trend, which has seen property prices in the area ​achieve 2.6% annual growth​.</p><p>The average Adur house price in March was £314,710, Land Registry figures show​ – a 1.3% increase on February.</p><p>Over the month, the picture was ​better than that across the South East, where prices ​increased 0.6%​, and Adur outperformed the 0.2% drop for the UK as a whole.</p><p>Over the last year, the average sale price of property in Adur ​​rose by £8,100 – putting the ​area 18th among the South East’s 67 local authorities for annual growth.</p><p>​The best annual growth in the region was in Gravesham, where properties increased on average by 14.6%, to £321,000. ​At the other end of the scale, properties in Chiltern dropped 5.7% in value, giving an average price of £527,000.</p><p></p><h3>Winners and Losers</h3><p>Owners of <strong>semi-detached houses</strong> saw the biggest improvement in property prices in Adur in March – they increased 1.6%, to £355,821 on average. Over the last year, prices rose by 3.6%.</p><p>Among other types of property:</p><ul><li><strong>Detached: </strong>up 1.5% monthly; up 2.6% annually; £484,516 average</li><li><strong>Terraced: </strong>up 1.1% monthly; up 3.2% annually; £300,590 average</li><li><strong>Flats: </strong>up 0.9% monthly; up 0.8% annually; £194,520 average</li></ul><p></p><p>​</p><h3>First steps on the property ladder</h3><p><strong>First-time buyers</strong> in Adur spent an average of £​265,300 on their property – ​£6,000 more than a year ago, ​and ​£46,000 more than in March 2015.</p><p>By comparison, <strong>former owner-occupiers</strong> paid £​348,100 on average in March​ – 31.2% more than first-time buyers.</p><p>​</p><h3>How do property prices in Adur compare?</h3><p>​</p><p>Buyers paid 2.7% less than the average price in the South East (£323,000) in March for a property in Adur. Across the South East, property prices are high compared to those across the UK, where the average cost £232,000.</p><p>The most expensive properties in the South East were in South Bucks – £595,000 on average, and 1.9 times as much as in Adur. South Bucks properties cost three times as much as homes in Southampton (£200,000 average), at the other end of the scale.</p><p>The highest property prices across the UK were in Kensington and Chelsea, where the average March sale price of £1.4 million could buy 16 properties in Burnley (average £86,000).</p><br><p></p><p></p><h3>Factfile</h3><p>Average property price in March</p><ul><li><strong>Adur: </strong>£314,710</li><li><strong>The South East: </strong>£323,353</li><li><strong>UK: </strong>£231,855</li></ul><p>Annual growth to March</p><ul><li><strong>Adur: </strong>+2.6%</li><li><strong>The South East: </strong>+2.0%</li><li><strong>UK: </strong>+2.1%</li></ul><p>Best and worst annual growth in the South East</p><ul><li><strong><span style=\"color: rgb(0, 0, 0);\">Gravesham: </span></strong><span style=\"color: rgb(0, 0, 0);\">+14.6%</span></li><li><strong><span style=\"color: rgb(0, 0, 0);\">Chiltern: </span></strong><span style=\"color: rgb(0, 0, 0);\">-5.7%</span></li></ul><p></p><!-- TRACKING START GA --><script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\nm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\nga('create', 'UA-72310761-1', 'auto', {'name': 'pacontentapi'});\nga('pacontentapi.set', 'referrer', location.origin);\nga('pacontentapi.set', 'dimension1', 'Joseph Hook, data reporter');\nga('pacontentapi.set', 'dimension2', 'ece9e032-9d38-4fbe-b256-881574b9c26e');\nga('pacontentapi.set', 'dimension3', 'paservice:news');\nga('pacontentapi.set', 'dimension6', 'story');\nga('pacontentapi.set', 'dimension7', 'text');\nga('pacontentapi.set', 'dimension8', null);\nga('pacontentapi.set', 'dimension9', null);\nga('pacontentapi.set', 'anonymizeIp', true);\nga('pacontentapi.send', 'pageview', { 'location': location.href, 'page': (location.pathname + location.search + location.hash), 'title': 'Adur house prices  increased more than across the South East in  March'});</script><!-- TRACKING END GA -->",
            "subject": [
                {
                    "code": "paservice:news",
                    "name": "News",
                    "profile": "paservice",
                    "scheme": "https://content.api.pressassociation.io/v1/subject",
                    "rel": "partOf"
                },
                {
                    "code": "pagenerator:nlg",
                    "name": "NLG",
                    "profile": "pagenerator",
                    "scheme": "https://content.api.pressassociation.io/v1/subject",
                    "rel": "generatedBy"
                }
            ],
            "place": [
                {
                    "code": "country:gbr",
                    "name": "United Kingdom",
                    "profile": "country",
                    "scheme": "https://www.wikidata.org/wiki/Property:P298",
                    "rel": "about"
                },
                {
                    "code": "local-authority:ons:E07000223",
                    "name": "Adur",
                    "profile": "local-authority",
                    "scheme": "http://geoportal.statistics.gov.uk/datasets/a267b55f601a4319a9955b0197e3cb81_0",
                    "rel": "about"
                }
            ],
            "associations": {
                "associated1": {
                    "type": "picture",
                    "copyrightholder": "PA Wire",
                    "copyrightnotice": "PA Wire/PA Images",
                    "usageterms": "FILE PHOTO",
                    "description_credit": "Andrew Matthews",
                    "renditions": {
                        "original": {
                            "href": "https://image.assets.pressassociation.io/v2/image/production/252e8d4016b861024aa6ecc0ec76a3edY29udGVudHNlYXJjaCwxNTkwMDU4NTg3/2.50321118.jpg",
                            "mimetype": "image/jpg",
                            "height": 1390,
                            "width": 2135
                        }
                    }
                }
            },
            "links": [
                {
                    "rel": "self",
                    "href": "https://content.api.pressassociation.io/v1/item/ece9e032-9d38-4fbe-b256-881574b9c26e"
                }
            ]
        },
        {
            "uri": "2a252030-1537-4357-90da-e4fe0a441dba",
            "type": "text",
            "profile": "story",
            "version": "1",
            "firstcreated": "2020-05-20T08:47:12Z",
            "versioncreated": "2020-05-20T08:47:12Z",
            "issued": "2020-05-20T08:47:12Z",
            "urgency": 4,
            "pubstatus": "usable",
            "language": "en",
            "byline": "Katie Williams, Data Reporter",
            "headline": "Official figures: no more West Sussex coronavirus cases",
            "description_shortheadline": "Coronavirus, May 19",
            "description_text": "No more cases of coronavirus have been recorded in West Sussex, the latest official figures show.",
            "description_html": "<p>No more cases of coronavirus have been recorded in West Sussex, the latest official figures show.</p>",
            "body_text": "No more cases of coronavirus have been recorded in West Sussex, the latest official figures show.\n\nPublic Health England figures show that 1,276 people had been confirmed as testing positive for Covid-19 by 9am Tuesday morning (May 19) in West Sussex, in line with the same time on Monday. A week before, there were 1,230 cases.\n\nThe stable number of cases over the three-day period contrasts with the picture across the UK as a whole, where the rate of increase was 1%.\n\nThey were among the 20,414 cases recorded across the South East, a figure which rose by 86 over the period.\n\nCumulative case counts include patients who are currently unwell, have recovered and those that have died.\n\nAcross the UK, 248,818 people had tested positive for coronavirus as of 9am on Tuesday, up from 246,406 at the same point on Monday, Department of Health and Social Care figures show. As of 5pm on Monday, 35,341 people had died.",
            "body_html": "<p>No more cases of coronavirus have been recorded in West Sussex, the latest official figures show.</p><p>Public Health England figures show that 1,276 people had been confirmed as testing positive for Covid-19 by 9am Tuesday morning (May 19) in West Sussex, in line with the same time on Monday. A week before, there were 1,230 cases.</p><p>The stable number of cases over the three-day period contrasts with the picture across the UK as a whole, where the rate of increase was 1%.</p><p>They were among the 20,414 cases recorded across the South East, a figure which rose by 86 over the period.</p><p>Cumulative case counts include patients who are currently unwell, have recovered and those that have died.</p><p>Across the UK, 248,818 people had tested positive for coronavirus as of 9am on Tuesday, up from 246,406 at the same point on Monday, Department of Health and Social Care figures show. As of 5pm on Monday, 35,341 people had died.<!-- EMBED START RADARGraphic --></p><figure><img src=\"https://radar-graphics-embed.pressassociation.com/7f6ed5d0-9a76-11ea-8968-874cd5c1cebc.svg\"/></figure><!-- EMBED END RADARGraphic --><!-- TRACKING START GA --><script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\nm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\nga('create', 'UA-72310761-1', 'auto', {'name': 'pacontentapi'});\nga('pacontentapi.set', 'referrer', location.origin);\nga('pacontentapi.set', 'dimension1', 'Katie Williams, Data Reporter');\nga('pacontentapi.set', 'dimension2', '2a252030-1537-4357-90da-e4fe0a441dba');\nga('pacontentapi.set', 'dimension3', 'paservice:news');\nga('pacontentapi.set', 'dimension6', 'story');\nga('pacontentapi.set', 'dimension7', 'text');\nga('pacontentapi.set', 'dimension8', null);\nga('pacontentapi.set', 'dimension9', null);\nga('pacontentapi.set', 'anonymizeIp', true);\nga('pacontentapi.send', 'pageview', { 'location': location.href, 'page': (location.pathname + location.search + location.hash), 'title': 'Official figures: no more West Sussex coronavirus cases'});</script><!-- TRACKING END GA -->",
            "subject": [
                {
                    "code": "paservice:news",
                    "name": "News",
                    "profile": "paservice",
                    "scheme": "https://content.api.pressassociation.io/v1/subject",
                    "rel": "partOf"
                },
                {
                    "code": "pagenerator:nlg",
                    "name": "NLG",
                    "profile": "pagenerator",
                    "scheme": "https://content.api.pressassociation.io/v1/subject",
                    "rel": "generatedBy"
                }
            ],
            "place": [
                {
                    "code": "country:gbr",
                    "name": "United Kingdom",
                    "profile": "country",
                    "scheme": "https://www.wikidata.org/wiki/Property:P298",
                    "rel": "about"
                },
                {
                    "code": "upper-tier-local-authority:ons:E10000032",
                    "name": "West Sussex",
                    "profile": "upper-tier-local-authority",
                    "scheme": "http://geoportal.statistics.gov.uk/datasets/41828627a5ae4f65961b0e741258d210",
                    "rel": "about"
                },
                {
                    "code": "local-authority:ons:E07000223",
                    "name": "Adur",
                    "profile": "local-authority",
                    "scheme": "http://geoportal.statistics.gov.uk/datasets/a267b55f601a4319a9955b0197e3cb81_0",
                    "rel": "about"
                }
            ],
            "renditions": {
                "sourcedata1": {
                    "href": "https://coronavirus.data.gov.uk/?_ga=2.184500710.1164753417.1587658274-688805621.1578396996"
                }
            },
            "associations": {
                "associated1": {
                    "type": "picture",
                    "copyrightholder": "PA Wire",
                    "copyrightnotice": "PA Wire/PA Images",
                    "usageterms": "",
                    "description_credit": "Ben Birchall",
                    "renditions": {
                        "original": {
                            "href": "https://image.assets.pressassociation.io/v2/image/production/328f4e4d04eec31597616dd69e761579Y29udGVudHNlYXJjaCwxNTkwMDUwNzIx/2.51260725.jpg",
                            "mimetype": "image/jpg",
                            "height": 1390,
                            "width": 2135
                        }
                    }
                }
            },
            "links": [
                {
                    "rel": "self",
                    "href": "https://content.api.pressassociation.io/v1/item/2a252030-1537-4357-90da-e4fe0a441dba"
                }
            ]
        }
    ],
    "links": [
        {
            "rel": "self",
            "href": "https://content.api.pressassociation.io/v1/item?product=paproduct%3Aradar&place=local-authority%3Aons%3AE07000223"
        }
    ]
}