To access the Naviaddress API using the Python programming language you must use the requests library
To access the Naviaddress API using the Python programming language you must use the requests library.
To do this, it must be installed using the pip command below.
> pip install requests
Then create a file main.py, which we add a few lines to.
First, we import the definition of the requests library.
In the next line, we make a Naviaddress API URL request, in which we indicate the container and the address of the object we want to receive (in our example, the address of the Russian Naviaddress office). For convenience, let's save the received response as a string in the variable r.
Prepare an object for easy access to the fields of the object. For this purpose we convert the string to a JSON object using the json() method.