How to get your API Key?

Before you started with using our REST API services, you will need to obtain your API key under your own user account.

  1. Login to your AfterShip account (Sign up free)
  2. Visit Apps > API and click add
  3. Click Generate API Key

API end point

Once you've registered your API it's easy to start requesting data from AfterShip.

All endpoints are only accessible via https and are located at api.aftership.com.



All API call must include this header in order to auth the usage of AfterShip API.

Replace your API_API_KEY with your own key.
aftership-api-key: YOUR_API_KEY
Content-Type: application/json


All the request and response are in JSON string.


Be nice. If you're sending too many requests too quickly, we'll send back a 429 error code (TooManyRequests).

You are limited to 600 reqs/min per account. Practically, this means you should (when possible) authenticate users so that limits are well outside the reach of a given user.

The API response headers also give you the following X-RateLimit value

X-RateLimit-Reset1406096275The unix timestamp when the rate limit will be reset.
X-RateLimit-Limit600The rate limit ceiling for your account per min.
X-RateLimit-Remaining598The number of requests left for the 1 minute window.

The Envelope

Every response is contained by an envelope. That is, each response has a predictable set of keys with which you can expect to interact:


The meta key is used to communicate extra information about the response to the developer. If all goes well, you'll only ever see a code key with value 200. However, sometimes things go wrong, and in that case you might see a response like:


The data key is the meat of the response. It may be a list of results, but either way this is where you'll find the data you requested.

Here is the example for a GET /couriers