Using Bruno to access the OpenCage geocoding API
Bruno is an open-source desktop client for interrogating APIs. Our geocoding API is very straight-forward, with only a single entry point and authentication via thekey
parameter you supply as a variable in your request. Many APIs are more
complex, and Bruno can be a useful tool for testing and debugging.
Nevertheless, as we know developers tend to have a preference to use the
tools they are familiar with, we thought it might be helpful
to publish a Bruno
"collection" to make it as simple as possible for any developer who wants
to access our API via this tool.
- Sign up for an OpenCage Geocoding API key, or if you already have one log in.
- Download and install the Bruno client from the Bruno website. Start the application
- Copy the OpenCage geocoding Insomnia collection, which you can find on GitHub, to your machine. Import the OpenCage collection into your Bruno client, being sure to select the type of the collection as "Insomnia Collection" You will be asked for the location of the directory in which Bruno will store this collection. Select your home directory or desktop or wherever else you would like to have it.
- Notice on the left hand side of the Bruno client you can now see a collection named "OpenCage Geocoder". Click on it and "OpenCage Reverse request" will appear. Click on that
-
In the center of the application you can now see the request and click
on the "Query" tab to see the various parameters.
Notice that the
key
parameter uses a variable namedOPENCAGE_API_KEY
. Set the value ofOPENCAGE_API_KEY
to your OpenCage API key.You can also set this as a local
secret
in your Bruno environment, read the details in the Bruno documentation. - Ok, now you're ready to start querying the OpenCage server. Run a query (press Cmd + Enter) and you should see a response from the OpenCage server Now you can change the parameter values or add some of the optional parameters we support.
- Happy geocoding!