How to connect ipapi to Google Sheets

ipapi is an API that provides web analytics with IP address lookup and location data. We can use ipapi to find external IP address programmatically, and to lookup location information like city, country, latitude, longitude, timezone, and ASN associated with an IP address. In this tutorial, we’ll show you how to connect ipapi to Google Sheets in 5 steps:

  1. Install the Apipheny add-on
  2. Obtain an access key
  3. Choose an ipapi endpoint
  4. Enter your ipapi request into Apipheny
  5. Run the ipapi request in your Google Sheet

Step 1.) Install and open the Apipheny add-on in Google Sheets

To pull data from ipapi into Google Sheets, first install and open the Apipheny Google Sheets add-on.

Apipheny is a no-code API integrator for Google Sheets that you can use to make unlimited API requests, connect to unlimited APIs, save API requests, schedule API requests, and more.

1. Install Apipheny by clicking here on desktop and then clicking the Install button on the next page

2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons or Extensions option in the top menu. In the add-ons menu, you should see Apipheny.

Click Apipheny > Import API to open the Apipheny sidebar in your Google Sheet:

Opening the Apipheny add-on in Google Sheets
Opening the Apipheny add-on in Google Sheets

Step 2.) Obtain an access key

After signing up for ipapi, your API Access Key will be displayed on the dashboard:

Ipapi dashboard
ipapi dashboard

Copy and paste the value of your API Access Key to a safe location because you’ll need it in the next steps.

Step 3.) Choose an ipapi endpoint

In this section, we’ll show you how to browse the ipapi documentation to find an API URL and endpoint that retrieves the specific information you need from ipapi. If you already know your API URL, or you want to use the same example URL as us, just skip to Step 4.

First, open the ipapi documentation page: https://ipapi.com/documentation

The menu on the left contains basic information about ipapi and a list of API endpoints you can query:

Ipapi documentation page
ipapi documentation page

In this example, we will describe the Bulk IP Lookup endpoint that you can use to look up multiple IP addresses at once:

http://api.ipapi.com/api/IP_ADDRESS_NO1,IP_ADDRESS_NO2,IP_ADDRESS_NO3?access_key=YOUR_ACCESS_KEY

If you use this endpoint, don’t forget to replace IP_ADDRESS_NO1, IP_ADDRESS_NO2, IP_ADDRESS_NO3 with real IP addresses and YOUR_ACCESS_KEY with the access key you previously obtained in Step 2.

The documentation for this endpoint contains a description of its functionality, an example request, the accepted path parameters, and an example API response:

Bulk IP Lookup endpoint documentation
Bulk IP Lookup endpoint documentation

All API calls to ipapi should be made using the http://api.ipapi.com/api/ base domain. All endpoints and parameters should be appended to this base domain.

Step 4.) Enter the ipapi request into the Apipheny add-on

Okay, we’re in the home stretch. Now go back to your Google Sheet and make sure that the Apipheny add-on is open on the “Import” tab. With the Import Tab open, enter these details into the add-on:

Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) as required by your ipapi endpoint. For this example, we are using the GET method.

API URL: In Step 3, we explained how you can find the ipapi endpoint that you need. Now copy the complete API URL into the Apipheny add-on, where it says API URL Path, followed by any GET parameters required for your query.

For this example, we are using the Standard Lookup for an IP address that gets the data behind an IP address. The corresponding URL for this endpoint is:

http://api.ipapi.com/IP_ADDRESS?access_key=ACCESS_KEY

If you use this URL, don’t forget to replace IP_ADDRESS with a real IP address and ACCESS_KEY with your previously obtained API access key.

Headers aren’t required, so you can leave this section blank in Apipheny.

Here’s what our request looks like in Apipheny:

Ipapi API request entered into Apipheny
Ipapi API request entered into Apipheny

Step 5.) Run the ipapi request in your Google Sheet

The last step is to click the Run button at the bottom of the Apipheny add-on and then your ipapi data will be imported into your Google Sheet, like so:

Ipapi data imported into Google Sheets
ipapi data imported into Google Sheets

After making a successful request to ipapi, try querying a different ipapi endpoint, or try using one of the more advanced features in the Apipheny add-on, such as:

Related Posts