Xsortal Grants API Reference
Xsortal Grants API Documentation
Last Updated: 20th July 2023
For further help email: support@xsortal.com
All API requests should send a Bearer Authentication header with your API Key.
For example:
Authorization: Bearer d445Ug1lk7
You can find your API key in the Grants API Subscription area of Get Business Grants.
Terms of Service
API Endpoints
https://api.xsortal.com:4001
Version
1.0.2
Get Started
Your application should use the GraphQL endpoint at https://api.xsortal.com:4001
All API requests should send an Authorization header along with your API key:
Authorization: Bearer d445Ug1lk7
Your API limits won't start until you perform your first API request. To help you get setup you can use our test API key as seen below:
Authorization: Bearer 123456789abcdefg
The test API key is unlimited and allows you to test your setup before switching to your live key. The test key will not return real-life grant results and will always return the same two sample grant results no matter which of the 4 limited queries (see below) you request.
Grants API – 5 Minute Matcher
We have a minimal HTML/CSS/JS code example that creates a basic grants matcher in a few minutes. You can view the code here: Grants API – 5 Minute Matcher
API Limits
API limits are only applied on those queries which return grant results i.e.:
- allPurposes
- purpose
- grant
- relatedGrants
The API imposes limits based on your level of subscription package. The limits are imposed based on two metrics:
Number of unique requests per month x Number of results returned per request
Definition of a unique request
A unique request is any unique combination of arguments passed to any of the API limited queries listed above. Should you request a query using a combination of arguments that you've already used in the last month then results will be returned as normal and there will be no impact on your API limit count.
The following arguments have no effect on your API limit: orderBy, orderByDirection, perPage, currentPage
Should you exceed your API limit then you will receive the below as a response:
{ "data": { "apiError": "You have reached your monthly API limit" } }
Monitoring your API limits
The below X-API Response Headers are sent with every response:
Name | Description | Example |
---|---|---|
x-api-max-monthly-requests | How many unique requests your subscription alows per month | 20 |
x-api-max-results-per-request | The maximum number of results returned per unique request | 20 |
x-api-total-unique-requests-this-month | How many unique requests have been made this month | 2 |
x-api-total-unique-requests-remaining-this-month | How many unique requests are remaining this month | 18 |
x-api-start-date | When your first request was made | Tue Mar 11 2022 07:38:14 GMT+0100 |
x-api-limit-start-date | When your current API limit period started | 11/02/2023, 07:38:14 |
x-api-limit-end-date | When your current API limit period will end | 11/03/2023, 07:38:14 |
Grant Overview
Our grants database contains thousands of grant. Each grant is broken down into various Funding Purposes. A single grant can have 1 or more Funding Purposes. A Funding Purpose is essentially the part of a grant that someone can apply to get money for.
It is recommended that your searches and results revolve around Funding Purposes rather than the overall encompassing grants as users apply for money at the Funding Purpose level.
Some examples of Funding Purposes are:
- Business Growth
- Job Creation
- Staff Development
- Working Capital
The full list of Funding Purposes can be obtained through the allFundingPurposes GraphQL query.
The main query you use to return a set of Funding Purpose results is allPurposes
The main query you use to return a single Funding Purpose result is purpose
List of available fields returned for a Grant or Purpose
Grant specific fields
Field | Type | Description | Example |
---|---|---|---|
id | integer | Unique number to identify the grant | 62 |
url | string | The URL of the grants home page | https://www.cofundni.com |
title | string | The title of the grant | Co-Fund NI Business Investment |
open_or_closed | enum | Is the grant Open, Opening, Closed or Closing | Opening |
currency | enum | The currency the grant amount is in ('£', '€', '$') | £ |
total_fund_size | integer | The size of the overall pot of money available across the grant's purposes - unformatted | 50000000 |
total_fund_size_formatted | string | The size of the overall pot of money available across the grant's purposes - formatted | 5,000,000 |
provider_1 | string | The main provider of the grant | Invest Northern Ireland |
provider_2 | string | The secondary provider of the grant | Clarendon Fund Managers |
provider_3 | string | The tertiary provider of the grant | European Commission |
funding_types | array | The types of funding provided | Equity Finance |
purposes | array | The available purposes for the grant. See below for the Purpose specific fields | Business Growth |
date_added | integer | The timestamp of when the grant was added into our database | 1678705244 |
Funding Purpose specific fields
Field | Type | Description | Example |
---|---|---|---|
id | integer | Unique number to identify the purpose | 204796 |
grant_id | integer | The id of the grant this purpose is attached to | 62 |
funding_purpose | string | The type of funding purpose | Business Growth |
funding_purpose_definition | string | Definition of the funding purpose | Business growth grants fund activities that help you increase sales or find new customers such as market research, marketing, website translation or the cost of launching a product. |
purpose_title | string | The title of the purpose | Co-Fund NI Business Investment |
purpose_url | string | The URL of the purpose's home page | http://www.cofundni.com |
purpose_application_url | string | The URL of the purpose's application page | https://www.cofundni.com/company-application-form.aspx |
purpose_size_min | integer | The minimum amount available for this purpose - unformatted | 150000 |
purpose_size_min_formatted | integer | The minimum amount available for this purpose - formatted | 150,000 |
purpose_size_max | integer | The maximum amount available for this purpose - unformatted | 1000000 |
purpose_size_max_formatted | integer | The minimum amount available for this purpose - formatted | 1,000,000 |
purpose_description | string | Description of the purpose | The Co-Fund NI programme aims to invest alongside private investors such as business angels or business angel syndicates into eligible SMEs. |
purpose_dates | string | Contains the relevant date or dates of the purpose. Could also display, for example, Ongoing if there are no relevant dates | Start Date for Applications: 9th January 2023 Application Deadline: 19th March 2023 |
purpose_region_is_uk | integer | Does this purpose cover the whole of the UK? 1=true 0=false | 0 |
deadline_date | integer | Timestamp, if any, of the purpose's deadline date | 1679184000 |
date_added | integer | The timestamp of when the purpose was added into our database | 1678705244 |
regions | array | The regions this purpose applies to | North West South East |
sectors | array | The sectors this purpose applies to. Can also show "All Sectors" if the purpose isn't sector specific | Construction Manufacturing |
business_types | array | The business types this purposes applies to | Small Business Medium Business |
Documentation Changelog
20th July 2023
- Added a link to our 5 Minute Matcher code example
- No changes to the API functionality.
14th July 2023
- Tidying up of some of the text/language used.
- More fields documentated
- No changes to the API functionality.
Queries
allBusinessTypes
Description
Returns all the possible Business Types. The main use of this query would be in a UI to present, for example, a drop down list of possible Business Types for the user to select.
Response
Returns [BusinessType!]!
Example
Query
query allBusinessTypes {
allBusinessTypes {
business_type
}
}
Response
{"data": {"allBusinessTypes": [{"business_type": "Medium Business"}]}}
allDateRanges
Description
Returns all the possible shortcut Date Ranges available which can be used to retrieve grants added in the Last Week, Last Month or Last Year.
This is current unused in the API.
Response
Returns [DateRange!]!
Example
Query
query allDateRanges {
allDateRanges {
id
text
}
}
Response
{"data": {"allDateRanges": [{"id": 1, "text": "Next Week"}]}}
allFundingAmounts
Description
Returns all the possible Funding Amount ranges. The main use of this query would be in a UI to present, for example, a drop down list of possible Funding Amount ranges for the user to select.
Response
Returns [FundingAmount!]!
Example
Query
query allFundingAmounts {
allFundingAmounts {
id
text
}
}
Response
{"data": {"allFundingAmounts": [{"id": 5, "text": "£100,000 - £149,999"}]}}
allFundingPurposes
Description
Returns all the possible funding purposes. The main use of this query would be in a UI to present, for example, a drop down list of possible funding purposes for the user to select.
Response
Returns [FundingPurpose!]!
Example
Query
query allFundingPurposes {
allFundingPurposes {
fundingpurpose
}
}
Response
{"data": {"allFundingPurposes": [{"fundingpurpose": "Business Innovation"}]}}
allFundingTypes
Description
Returns all the possible Funding Types. The main use of this query would be in a UI to present, for example, a drop down list of possible Funding Types for the user to select.
Response
Returns [FundingType!]!
Example
Query
query allFundingTypes {
allFundingTypes {
fundingtype
}
}
Response
{"data": {"allFundingTypes": [{"fundingtype": "Funding for Project Costs"}]}}
allPurposes
Description
Returns all matching purposes.
This is the main query you will be using throughout your applications to retrieve relevant and matching purposes (as opposed to grants).
Response
Returns a PurposeList
Arguments
Name | Description |
---|---|
id - Int
|
|
funding_purpose - String
|
|
region - String
|
One of the regions available in the allRegions response e.g. North West, Scotland, Wales, South East |
sector - [String]
|
One or more of the sectors available in the allSectors response e.g. Construction, Manufacturing |
sectorOnly - Int
|
If set to 1 then only grants that match the given sector exactly will be returned, if 0 then those grants that apply to All Sectors will also be returned |
noEU - Int
|
If set to 1 then European Commission grants will be removed from your results |
business_type - String
|
One of the business types available in the allBusinessTypes response e.g. Academic, Large Business, Medium Business, Start-ups |
funding_amount - Int
|
One of the ID numbers available in the allFundingAmounts response that aligns with a range of funding amounts e.g. 5 - which represents the range £100,000 - £149,999. You can define your own minimum, maximum or both (your own range) by using the funding_amount_min and funding_amount_max fields instead. |
funding_amount_min - Int
|
An integer representing the minimum funding amount - this, along with funding_amount_max, is an alternative to using the pre-defined funding ranges in the funding_amount field. If either funding_amount_min or funding_amount_max are specified then the funding_amount field will be ignored if that is also specified. You can specify just a minimum, just a maximum, or both to define your own range. |
funding_amount_max - Int
|
An integer representing the minimum funding amount - this, along with funding_amount_min, is an alternative to using the pre-defined funding ranges in the funding_amount field. If either funding_amount_min or funding_amount_max are specified then the funding_amount field will be ignored if that is also specified. You can specify just a minimum, just a maximum, or both to define your own range. |
funding_type - [String]
|
One of the funding types available in the allFundingTypes response e.g. Business Grants, Interest Free Loan, Equity Finance |
orderBy - String
|
How to order the results. It defaults to order by the purpose_size_max (the maximum amount available) DESC. You can also order by deadline_date, date_added, sector or funding_purpose |
orderByDirection - String
|
The orderBy direction, either ASC (default) or DESC |
perPage - Int
|
The number of results to return. This must be less than, or equal, to your subscription API total number of results per request (also returned in the x-api-max-results-per-request response header). If you are on an unlimted subscription then you can set this to a number less than or equal to the default of 25 |
currentPage - Int
|
Which page of results to return. For limited API subscriptions this field has no effect and will always default to 1. |
startDate - Int
|
A Unix time stamp that when used in conjunction with endDate will only return grants added to the database within the given time frame |
endDate - Int
|
A Unix timestamp that when used in conjunction with startDate will only return grants added to the database within the given time frame |
lastWeek - Boolean
|
If set to true only grants added to the database in the last week, relative to the NOW() time, will be returned |
deadlineStartDate - Int
|
A Unix timestamp that when used in conjunction with deadlineEndDate will only return grants with a deadline_date between deadlineStartDate and deadlineEndDate. Cannot be used in conjunction with starDate and endDate |
deadlineEndDate - Int
|
A Unix timestamp that when used in conjunction with deadlineStartDate will only return grants with a deadline_date between deadlineStartDate and deadlineEndDate. Cannot be used in conjunction with starDate and endDate |
Example
Query
query allPurposes(
$id: Int,
$funding_purpose: String,
$region: String,
$sector: [String],
$sectorOnly: Int,
$noEU: Int,
$business_type: String,
$funding_amount: Int,
$funding_amount_min: Int,
$funding_amount_max: Int,
$funding_type: [String],
$orderBy: String,
$orderByDirection: String,
$perPage: Int,
$currentPage: Int,
$startDate: Int,
$endDate: Int,
$lastWeek: Boolean,
$deadlineStartDate: Int,
$deadlineEndDate: Int
) {
allPurposes(
id: $id,
funding_purpose: $funding_purpose,
region: $region,
sector: $sector,
sectorOnly: $sectorOnly,
noEU: $noEU,
business_type: $business_type,
funding_amount: $funding_amount,
funding_amount_min: $funding_amount_min,
funding_amount_max: $funding_amount_max,
funding_type: $funding_type,
orderBy: $orderBy,
orderByDirection: $orderByDirection,
perPage: $perPage,
currentPage: $currentPage,
startDate: $startDate,
endDate: $endDate,
lastWeek: $lastWeek,
deadlineStartDate: $deadlineStartDate,
deadlineEndDate: $deadlineEndDate
) {
totalResults
totalResultsPerPage
totalPages
currentPage
nextPage
results {
...PurposeFragment
}
}
}
Variables
{
"id": "28856",
"funding_purpose": "Research and Development",
"region": "North West",
"sector": "Construction",
"sectorOnly": "1",
"noEU": "1",
"business_type": "Medium Business",
"funding_amount": 123,
"funding_amount_min": 987,
"funding_amount_max": 123,
"funding_type": ["xyz789"],
"orderBy": "xyz789",
"orderByDirection": "xyz789",
"perPage": 987,
"currentPage": 123,
"startDate": 987,
"endDate": 123,
"lastWeek": true,
"deadlineStartDate": 123,
"deadlineEndDate": 123
}
Response
{
"data": {
"allPurposes": {
"totalResults": 355,
"totalResultsPerPage": 123,
"totalPages": 35,
"currentPage": 4,
"nextPage": 5,
"results": ["An array of Purpose objects"]
}
}
}
allRegions
Description
Returns all the possible Regions. The main use of this query would be in a UI to present, for example, a drop down list of possible Regions for the user to select.
Response
Returns [Region!]!
Example
Query
query allRegions {
allRegions {
region
region_type
display_region
}
}
Response
{
"data": {
"allRegions": [
{
"region": "East Midlands",
"region_type": "nuts",
"display_region": "Derbyshire"
}
]
}
}
allSectors
Description
Returns all the possible Sectors. The main use of this query would be in a UI to present, for example, a drop down list of possible Sectors for the user to select.
Response
Returns [Sector!]!
Arguments
Name | Description |
---|---|
sector_or_top_level - String
|
All the sectors are assigned a higher level grouping we call it's 'top level' sector. When asking for the list of sectors you can request the top level listing rather than the default 'sector' level by passing 'top_level' as the sector_or_top_level argument. For example, allSectors(sector_or_top_level: 'top_level'). |
Example
Query
query allSectors($sector_or_top_level: String) {
allSectors(sector_or_top_level: $sector_or_top_level) {
sector
top_level
}
}
Variables
{"sector_or_top_level": "sector"}
Response
{
"data": {
"allSectors": [
{"sector": "Advanced Manufacturing", "top_level": "Manufacturing"}
]
}
}
grant
Description
Returns a single grant if an id is passed otherwise up to 25 grants if a title is passed. Note: This refers to grants as opposed to purposes (A grant is made up of 1 or more purposes).
When using the test API key this will always return the same grant regardless of the ID you pass in.
Response
Returns [Grant!]!
Arguments
Name | Description |
---|---|
id - Int
|
The internal ID of the grant |
title - String
|
The title of the grant. This is used to perform a wildcard search of grant titles. For example, if you pass 'energy' as the grant title then a search for '%energy%' will be performed. |
limit - Int
|
When performing a title search this defines how many results to return. It defaults to, and has a maximum of, 25 grant results. |
Example
Query
query grant(
$id: Int,
$title: String,
$limit: Int
) {
grant(
id: $id,
title: $title,
limit: $limit
) {
id
url
title
open_or_closed
currency
total_fund_size
total_fund_size_formatted
provider_1
provider_2
provider_3
provider_4
funding_types {
...FundingTypeFragment
}
purposes {
...PurposeFragment
}
date_added
}
}
Variables
{"id": 123, "title": "abc123", "limit": 987}
Response
{
"data": {
"grant": [
{
"id": 123,
"url": "xyz789",
"title": "xyz789",
"open_or_closed": "abc123",
"currency": "abc123",
"total_fund_size": "abc123",
"total_fund_size_formatted": "xyz789",
"provider_1": "abc123",
"provider_2": "abc123",
"provider_3": "abc123",
"provider_4": "abc123",
"funding_types": [FundingType],
"purposes": [Purpose],
"date_added": 987
}
]
}
}
overallTotals
Description
Returns a response containing the overall totals of the database content. E.g. the total number of grants in the database, the total amount of funding available across the total grants, how many grants were added to the database in the last month.
Response
Returns an OverallTotals!
Example
Query
query overallTotals {
overallTotals {
total_schemes
total_available_formatted
total_funding_purposes
total_added_last_month
}
}
Response
{
"data": {
"overallTotals": {
"total_schemes": "2613",
"total_available_formatted": "£4.3bn",
"total_funding_purposes": "10",
"total_added_last_month": "214"
}
}
}
purpose
Description
Returns a single purpose as opposed to a frant. Note: A grant is made up of 1 or more purposes and a purpose is what a end-user would apply for. In most cases you would be presenting purpose(s) to an end-user rather than a grant.
When using the test API key this will always return the same purpose regardless of the ID you pass in.
Example
Query
query purpose($id: Int!) {
purpose(id: $id) {
id
grant_id
funding_purpose
funding_purpose_definition
purpose_title
purpose_url
purpose_application_url
purpose_size_min
purpose_size_min_formatted
purpose_size_max
purpose_size_max_formatted
purpose_description
purpose_dates
purpose_region_is_uk
deadline_date
date_added
grant {
...GrantFragment
}
regions {
...RegionFragment
}
sectors {
...SectorFragment
}
business_types {
...BusinessTypeFragment
}
}
}
Variables
{"id": 987}
Response
{
"data": {
"purpose": {
"id": 123,
"grant_id": 123,
"funding_purpose": "xyz789",
"funding_purpose_definition": "abc123",
"purpose_title": "abc123",
"purpose_url": "abc123",
"purpose_application_url": "xyz789",
"purpose_size_min": 123,
"purpose_size_min_formatted": "xyz789",
"purpose_size_max": 123,
"purpose_size_max_formatted": "abc123",
"purpose_description": "abc123",
"purpose_dates": "xyz789",
"purpose_region_is_uk": 987,
"deadline_date": 987,
"date_added": 987,
"grant": Grant,
"regions": [Region],
"sectors": [Sector],
"business_types": [BusinessType]
}
}
}
Types
Boolean
Description
The Boolean
scalar type represents true
or false
.
BusinessType
Description
The type of business. For example, Small Business, Medium Business, Large Business, Academic.
Fields
Field Name | Description |
---|---|
business_type - String!
|
The type of business |
Example
{"business_type": "Medium Business"}
DateRange
FundingAmount
Description
A funding amount represented by an id and a textual representation of the range. For example, id:4 text:£50,000 - £99,999
Example
{"id": 5, "text": "£100,000 - £149,999"}
FundingPurpose
Description
A funding purpose is the purpose the available money can be used for.
Fields
Field Name | Description |
---|---|
fundingpurpose - String!
|
The funding purpose. For example, Business Growth, Business Innovation, Starting a Business |
Example
{"fundingpurpose": "Business Innovation"}
FundingType
Description
The type of funding being offered. For example, Interest Free Loan, Funding for Project Costs, Equity Finance, Business Grants.
Fields
Field Name | Description |
---|---|
fundingtype - String!
|
A string containing the funding type |
Example
{"fundingtype": "Funding for Project Costs"}
Grant
Description
The Grant type represents a single grant (as opposed to a purpose - grants are broken down into 1 or more purposes).
Fields
Field Name | Description |
---|---|
id - Int!
|
The internal ID number of the grant |
url - String!
|
The URL of the grant page. This may or may not be the same as the application URL that apprears in the Purpose type below |
title - String!
|
The title of the grant |
open_or_closed - String!
|
The status of the grant - can be open, opening or closing. |
currency - String
|
The currency of the all the various funding amount fields in both the grant and it's purposes. For example, £, $, € |
total_fund_size - String
|
The total amount of money available. This may be split across the grants various purposes. For example, 10000000 |
total_fund_size_formatted - String
|
The total_fund_size above number formatted. For example, 10,000,000 |
provider_1 - String!
|
The main provider of this grant. For example, Innovate UK |
provider_2 - String
|
Quite often a grant has multiple providers. Providers _2, _3 and _4 below list those. For example, Gwynedd Council. |
provider_3 - String
|
|
provider_4 - String
|
|
funding_types - [FundingType]
|
A list of the FundingTypes available. For example, Business Grants, Interest Free Loan. |
purposes - [Purpose]
|
A list of 1 or more Purposes (click here to view the Purpose definition). A user applies for the money at the purpose level. |
date_added - Int!
|
A unix timestamp of the date the grant was added to the grants database |
Example
{
"id": 123,
"url": "abc123",
"title": "xyz789",
"open_or_closed": "xyz789",
"currency": "xyz789",
"total_fund_size": "abc123",
"total_fund_size_formatted": "xyz789",
"provider_1": "abc123",
"provider_2": "xyz789",
"provider_3": "xyz789",
"provider_4": "xyz789",
"funding_types": [FundingType],
"purposes": [Purpose],
"date_added": 987
}
Int
Description
The Int
scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
Example
123
OverallTotals
Description
Returns the overall database totals
Fields
Field Name | Description |
---|---|
total_schemes - Int!
|
Total number of Schemes in the result set |
total_available_formatted - String!
|
The total amount of funding available as a formatted string |
total_funding_purposes - Int!
|
The total number of funding purposes |
total_added_last_month - Int!
|
The total number of schemes added in the last month |
Example
{
"total_schemes": "2613",
"total_available_formatted": "£4.3bn",
"total_funding_purposes": "10",
"total_added_last_month": "214"
}
Purpose
Description
The Purpose type represents a single purpose (as opposed to a grant - grants are broken down into 1 or more purposes). In the majority of cases you will be displaying a Purpose to the end user.
Fields
Field Name | Description |
---|---|
id - Int!
|
The internal ID number of the purpose |
grant_id - Int!
|
The internal ID number of the grant this purpose belongs to. |
funding_purpose - String!
|
The funding purpose this purpose is for. For example, Business Innovation, Business Growth. |
funding_purpose_definition - String
|
The textual description of the funding purpose. For example, 'Business growth grants fund activities that help you increase sales or find new customers such as market research, marketing, website translation or the cost of launching a product.'. |
purpose_title - String!
|
The title of the purpose |
purpose_url - String
|
The URL of the page that contains the purpose details. |
purpose_application_url - String
|
The URL of the page that contains the purpose application details. |
purpose_size_min - Int
|
The minimum amount available. For example, 1000. Can be NULL if non specified. |
purpose_size_min_formatted - String
|
The minimum amount available in number format. For example, 1,000. Can be NULL if non specified. |
purpose_size_max - Int
|
The maximum amount available. For example, 50000. Can be NULL if non specified. |
purpose_size_max_formatted - String
|
The maximum amount available in number format. For example, 50,000. Can be NULL if non specified. |
purpose_description - String
|
The textual description of this purpose. For example, 'This scheme is providing grants for SMEs to help them purchase equipment and access consultancy services that will help them to recover from the COVID-19 crisis.'. |
purpose_dates - String
|
A textual description of the key dates that are relevant for this purpose. Multiple dates are separated by a newline. For example, Start Date for Applications: 15th June 2023 Application Deadline: 27th September 2023. For those purposes that have no specific date(s) this field will show 'Ongoing'. |
purpose_region_is_uk - Int
|
For those purposes that covert all of Northern Ireland, Scotland, Wales and England this will be set to 1 to indicate it covers the whole of the UK. Otherwise it will be set to 0. |
deadline_date - Int
|
A unix timestamp containing the key deadline date. |
date_added - Int
|
A unix timestamp containing the date the purpose was added into the grants database. |
grant - Grant!
|
The Grant type associated with this purpose. |
regions - [Region!]!
|
The Region types that this purpose applies to. |
sectors - [Sector!]!
|
The Sector types that this purpose applies to. |
business_types - [BusinessType!]!
|
The Business types that this purpose applies to. |
Example
{
"id": 123,
"grant_id": 987,
"funding_purpose": "xyz789",
"funding_purpose_definition": "abc123",
"purpose_title": "xyz789",
"purpose_url": "xyz789",
"purpose_application_url": "xyz789",
"purpose_size_min": 123,
"purpose_size_min_formatted": "xyz789",
"purpose_size_max": 123,
"purpose_size_max_formatted": "xyz789",
"purpose_description": "xyz789",
"purpose_dates": "xyz789",
"purpose_region_is_uk": 123,
"deadline_date": 987,
"date_added": 987,
"grant": Grant,
"regions": [Region],
"sectors": [Sector],
"business_types": [BusinessType]
}
PurposeList
Description
When you perform an allPurposes query (which is the main query you'd typically use for retrieving results), it will return a PurposeList which contains summary information about the result and an array of purposes (results).
Fields
Field Name | Description |
---|---|
totalResults - Int!
|
How many purposes are there in total regardless of any pagination values. |
totalResultsPerPage - Int!
|
How many purposes are being returned per page. |
totalPages - Int!
|
How many total pages there are. |
currentPage - Int!
|
Which page of the results is currently being returned. |
nextPage - Int!
|
The number of the next page of results. This will be set to 0 if, for example, you're currently on the last page. |
results - [Purpose!]!
|
An array of Purpose results that you present to the end user. |
Example
{
"totalResults": 355,
"totalResultsPerPage": 123,
"totalPages": 35,
"currentPage": 4,
"nextPage": 5,
"results": ["An array of Purpose objects"]
}
Region
Description
The Region type represents the region assigned to a purpose.
Fields
Field Name | Description |
---|---|
region - String!
|
The region name |
region_type - String!
|
The type of region. For example, country, county, lga. |
display_region - String!
|
The display_region field is the field that should be displayed to the end-user. Due to the hierarchical nature of regions there are situations where region and display_region may be different, in most cases you only need to use display_region. |
Example
{
"region": "East Midlands",
"region_type": "nuts",
"display_region": "Derbyshire"
}
Sector
Description
A Sector is made up of a Sector title and its Parent/Top Level Sector title. For example, the sector Advanced Manufacturing is under the Parent/Top Level sector called Manufacturing.
Example
{"sector": "Advanced Manufacturing", "top_level": "Manufacturing"}
String
Description
The String
scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
Example
"xyz789"