Services are the main channels of content available from PA, with each broken down further by two or more sub-services. The services are:
Content API is built around an entitlement model which basically means when we provision your API key we activate certain services against it (e.g. the News or Sport services). When you make a request to the Service Collection endpoint you will only ever see the services or sub-services you're entitled to access.
If you'd like to expand these services please contact the PA Commercial team on 020 7963 7624.
To return just the parent or top-level services you can utilise the query functionality. You can request that all services are returned that do not have subject properties with a profile of paservice.
Making the following request will list all available (and entitled) parent services:
curl \ -H "Accept: application/json" \ -H "apikey: <API KEY>" \ https://content.api.pressassociation.io/v1/service?query=!subject.profile:"paservice"
A service can have several sub-services, for example the service "Sport" has several sub-services including: Football, Tennis and F1.
Making the following request will list all available (and entitled) sub-services for a service:
curl \ -H "Accept: application/json" \ -H "apikey: <API KEY>" \ https://content.api.pressassociation.io/v1/service?parentSubject=paservice:sport
Please refer to the Pagination section of this documentation.
Please refer to the Content Negotiation section of this documentation.
There are two methods of retrieving items for a service.
The first (and more verbose) way is to query the /item endpoint by providing a subject parameter, for example:
curl \ -H "Accept: application/json" \ -H "apikey: <API KEY>" \ https://content.api.pressassociation.io/v1/item?subject=paservice:sport
The alternative, shortcut version is to simply call the item endpoint of the service resource, for example:
curl \ -H "Accept: application/json" \ -H "apikey: <API KEY>" \ https://content.api.pressassociation.io/v1/service/paservice:sport/item
Please refer to the Partial Response section of this documentation.
Articles in each service carry a range of metadata to identify the subject matter and, where appropriate, type of story, geographical territory, plus additional categories for sport content.
Updated about 3 years ago