How to make your first API call

Step by step guide

Step 1 - Open the answr API Reference

Before you start making your first API call, open the answr API Reference. You can find it in the answr Web app or through the answr documentation.


The documentation provides complete reference on the authentication process, but also on how different statistics and data layers, like Climatic variables and Natural disasters, can be requested.

This guide provides you a short introduction on how to make your first answr API call.

Step 2 - Choose your programming language

Depending on what programming language you prefer, we have currently code examples for requests and responses in cURL, Python, Javascript, MATLAB and R available.

Check out the chapter 👩💻Code Samples and choose the programming language you want to use.

pageCode Samples

Copy the code from "Step 1" and set up your console for performing your authentication process!

If you wish to get code samples in other programming languages, please send us your request through our community support form.

Step 3 - Authentication

As a first step you will need to authenticate yourself.

Below you can find a code example in Python. Exchange the dummy email and password with your account credentials.

import requests
headers = { 'accept': 'application/json', 'Content-Type': 'application/json', 
json_data = { 'email': '', 'password': 'password', }
response ='',
 headers=headers, json=json_data)

If the request was successful (value = 200), you will receive a Authentication Token (Bearer), which will have the following format:


Use it to perform your first data requests.

Step 4 - First data request

Once you have authenticated yourself and received your Token, you can start requesting data through the answr API. You will find the Code how to perform your first data request in different programming languages, in "Step2" of the 👩💻Code Samples.

pageCode Samples

For each API call, we cache the response for 30 minutes. This means that when you call multiple times a specific API endpoint with the same coordinates, the response is instantly available and we do not count additional requests from the authenticated account

Here is again an example in Python. Replace the word "TOKEN" with the Authentication Token you have received in the authentication process:

headers = { 'accept': 'headers = 
{ 'accept': 'application/json', 'Authorization': 'Bearer TOKEN', } 
params = { 'Input_point': '{"type":"point","data":{"lng":69.104192266327,"lat":36.2471504211426}}', }

response = requests.get('',
 params=params, headers=headers) 

Response: (Average frost days per month on the chosen location)


Congratulations! You successfully performed your first data request.

Last updated