Search API Connector Documentation
Import AfterShip Data to Google Sheets
In this guide, we’ll pull AfterShip data into Google Sheets, using the API Connector add-on for Sheets. AfterShip is an eCommerce shipping tracking service that allows you to get shipping data for over 697 couriers around the world! Let’s jump in and start exploring what kind of data we can pull into Google Sheets.
Contents
- Before You Begin
- Part 1: Get your AfterShip API key
- Part 2: Create Your API Request URL For Courier Data
- Part 3: Pull Full Courier List into Sheets
- Part 4: Create an AfterShip API Request URL To Get Courier Based On Tracking Number
- Part 5: POST Your Request to Get Courier Service
- Part 6: Other Available Endpoints
- Part 7: Handle Pagination
- Part 8: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Get Your Aftership API Key
- After signing up or logging in, you will need to fetch your API key. From the admin website, head to Settings -> API Keys.
- There will be a pre-generated API key you can use just fine, otherwise you can generate a new one if you fancy. That’s it, you now have access to the Aftership API!
Part 2: Create Your API Request URL
The API Request URL we will put into API Connector will consist of the base URL and an endpoint. Let’s setup an endpoint to GET all the couriers supported by AfterShip.
- Base URL:
https://api.aftership.com/v4
- Endpoint:
/couriers/all
Putting it together, we get the full API request URL:
https://api.aftership.com/v4/couriers/all
Part 3: Pull Aftership API Data into Sheets
We can now enter this URL into API Connector and grab that data.
In API Connector, enter your URL along with your aftership-api-key
as the key and YOUR_API_KEY
as the value under headers. You should have something like the following picture:

Save and Run your API Request. Congratulations! You should now have a list of 711 or more couriers that are supported by AfterShip, something like below:

Part 4: Create an AfterShip API Request URL To Get Courier Based On Tracking Number
Contrary to what this section header says, you will actually need to make a POST request in order to get back this data.
What data is that you say?
Say you have a shipping number, like “906587618687” for example, and you need to figure out which courier service it is, then this part is for you!
Just like earlier, you will need to setup a base URL along with the appropriate end point. Let’s set that up below:
- Base URL:
https://api.aftership.com/v4
- Endpoint:
/couriers/detect
Combine these along with your aftership-api-key
as the key and YOUR_API_KEY
as the value under headers. You will need to manually add another key and value pair of content-type
and application/json
respectively.
Next, because this is a POST request, you will need to add some text to the “POST body”. For this particular service, it will need to have the following format (you may copy and paste the below code for demonstration sake):
{
"tracking": {
"tracking_number": "906587618687"
}
}
That should be everything. Let’s check real quick and make sure everything is filled in correctly:

Part 5: POST Your Request to Get Courier Service
After saving and running your POST command, you should get back an entry that says which courier service is/was responsible for this tracking number. In our example case, it’s FedEx!

Part 6: More Example API URLs
There are loads more endpoints you can mess around with over in the documentation. I’ve done some digging for you and found a few that may be interesting:
- https://api.aftership.com/v4/last_checkpoint/:slug/:tracking_number
- https://api.aftership.com/v4/notifications/:slug/:tracking_number
Note: “:slug” refers to the slug for the courier service. You can see what these are from the results in Part 3.
Part 7: Handle Pagination
By default, Aftership will send through a limited number of tracking records unless you add the page
and limit
parameters as shown in their documentation.

You can run through these request URLs manually, or use API Connector’s pagination handling function to loop through these pages automatically, like this:
- API URL: https://api.aftership.com/v4/trackings?page=1&limit=200
- Pagination type:
page parameter
- Page parameter:
page
- Run until: choose when the request should stop running
Part 8: API Documentation
Official documentation: https://developers.aftership.com/reference/overview
How to get all the tracking numbers and automatically track its statuses?
Hi Maria!
I believe you can use this URL to get the information you are looking for:
https://api.aftership.com/v4/trackings
If that one isn’t working for ya, email support and we’ll do our best to get you setup. Thanks!
Doug