API Call Examples

Below are sample code for accessing the open data API using different programming languages.

Node.js

Steps to execute the Node.js code:

1. Save the code in a file with a .js extension, for example api_example.js.

2. Replace YOUR_API_KEY_HERE with your actual API key. To get the key, please refer to the Quick Start guide.

3. Execute the code using the following command:

node api_example.js

Python

Steps to execute the Python code:

1. Make sure to install the requests library:

pip install requests

2. Save the code in a file with a .py extension, for example api_example.py.

3. Replace YOUR_API_KEY_HERE with your actual API key. To get the key, please refer to the Quick Start guide.

4. Execute the code using the following command:

python api_example.py

Java

Steps to execute the Java code:

1. Save the code in a file with a .java extension, for example api_example.java.

2. Replace YOUR_API_KEY_HERE with your actual API key. To get the key, please refer to the Quick Start guide.

3. Compile the code using javac:

javac api_example.java

4. Execute the code using the following command:

java api_example

C#

Steps to execute the C# code:

1. Create a new C# Console App project.

2. Replace the content of Program.cs with the code above.

3. Replace YOUR_API_KEY_HERE with your actual API key. To get the key, please refer to the Quick Start guide.

4. Press F5 to execute if you are using Visual Studio or using the following command:

dotnet run