We offer a few shortcut options for API users to auto-generate API calls, without having to go through the full documentation or manually construct the code syntax.
Using the API Documentation in Interactive mode
The API Documentation pages on this site offer an interactive mode where users can click on their selected criteria and the API call with the correct syntax will be auto-generated for them.
Follow these steps to switch to the interactive mode:
Go to the method in the documentation that you want to test, e.g. /series/search
Click on the “Authorize” button at "API Query Builder" section on the left side and enter your API key to get access to the interactive mode<
Select all relevant parameters you want to include in your API query and click on "Add Parameter" button
Set values to the selected parameters and click on "Execute” button
You will get on the screen your API request HTTPS URl, as well as the response from this call
Auto-generating API calls on CEIC Online data platform
Users who prefer to use the CEIC online platform CDMNext for auto-generating API calls can do that using the copy-to-clipboard (CTC) options on the platform for search and series retrieval queries.
Watch this video for a quick demo of CDMNext CTC options for API or check the steps below.
Steps to auto-generate API series search code, using the CDMNext Search section CTC options:
Input the search keyword / Series ID(s) / SR codes
Apply any filter of function to the search result
Click on the drop down arrow and select the desired API type
Paste (CTR+V) the auto-generated code in your selected environment to perform the same search there.
Steps to auto-generate API series search code, using the CDMNext Search section CTC options:
Select the series you want
Click "Download"
Navigate to "Series" tab
Select the API option
Select the "API Type" (HTTP request, Python, PHP or JavaScript SDK)
Select the "Missing observations" type - skip the observations with no value or leave them as blank
Select the "Response format" (JSON, XML or CSV) - the format in which to download the data; this is available only if "http request" is selected in step #5
Paste (CTR+V) the auto-generated code in your selected environment to retrieve the series there
Steps to auto-generate API insights retrieval code, using CDMNext Download section CTC options:
Select the insight you want
Click "Download"
Navigate to "Views" tab
Select the API option
Select the "API Type" (HTTP request, Python, PHP or JavaScript SDK)
Select the "Response format" (PDF or XLSX) - the format in which to retrieve the insight - only full insight documents can be retrieved
Paste (CTR+V) the auto-generated code in your selected environment to retrieve the series there