Configure Performance Settings - Open Data API
There are a number of configuration settings for the API that are designed to ensure it can perform well. In most cases the default settings will be suitable, but you may wish to adjust the settings to suit your requirements.
Rate Limit
Access to the Open Data API is subject to rate limiting: any user who submits too many requests within a short period of time will be unable to submit further requests until their limit resets. This is to ensure that the API performs well for all users and that it is not possible for a single application to overload the server.
By default, the the Open Data API allows any given API key to submit up to 100 requests per hour. You can change this limit by editing a setting in the Open Data API's configuration.properties file:
Open the configuration file in a text editor. It is located at <tomcat_home>\webapps\webapi#rest#v1\WEB-INF\classes\configuration.properties
The Open Data API has its own copy of this configuration file. You must make the change in this file, not the equivalent file in the SuperWEB2 directory.
Locate the following setting:
CODEopenDataApi.schema.numberOfRateLimitPerPeriod=
Change the setting to your preferred number of allowed requests per hour. For example, to allow each API key to make 200 requests per hour, change it to the following:
CODEopenDataApi.schema.numberOfRateLimitPerPeriod=200
- Save your changes, and restart Tomcat.
Pagination
If a request to the /schema
endpoint returns a large number of results, it will be split into pages. Each page of results contains a link to the next set of results.
By default, the threshold for pagination is 100 results, but you can adjust this by changing the openDataApi.schema.pageSize
in the Open Data API's configuration.properties file:
Open the configuration file in a text editor. It is located at <tomcat_home>\webapps\webapi#rest#v1\WEB-INF\classes\configuration.properties
The Open Data API has its own copy of this configuration file. You must make the change in this file, not the equivalent file in the SuperWEB2 directory.
Locate the following setting:
CODEopenDataApi.schema.pageSize=
Change the setting to your preferred page size. For example, to allow up to 200 results before pagination, change it to the following:
CODEopenDataApi.schema.pageSize=200
- Save your changes, and restart Tomcat.
Maximum Request and Response Limits
The API also has limits on:
- The maximum number of cells that can be returned to a client.
- The maximum number of field ietms that a user can query against.
These limits are designed to prevent very large tables from being generated, as there is a risk these might overwhelm the server.
By default, up to 1,000,000 cells can be requested, and up to 1,000,000 field items can be queried against. If you need to adjust these settings, you can do so by editing the following section of the Open Data API's configuration.properties file:
#================================================================================================================
# OPEN DATA API - TABLE
#================================================================================================================
# Integer. Default 1,000,000
# Maximum number of cells that can be returned to a client via the table API.
# Use this limit to prevent excessively large tables from being sent to the client.
openDataApi.table.maximumResponseCellLimit=
# Integer. Default 1,000,000
# Maximum number of field items a user can query against the table API.
# Use this limit to prevent clients from overwhelming the server with large requests.
openDataApi.table.maximumRequestItemLimit=
After making your changes, you will need to restart Tomcat to apply the changes.