How to Use Curl

All of the examples in ShipEngine's documentation include an example curl command. Curl is a free, open source, command-line tool that's already installed on most operating systems.

Tip To see if you already have curl installed, open your terminal and type curl --version.
If it's installed, then you'll see the version number and which features are enabled.

Learning Resources

Curl's own documentation has loads of great resources, including this excellent scripting tutorial. In addition, Nordic APIs has an informative guide to some of Curl's hidden powers.

Running Curl Examples in Terminal

Since curl is already installed on most computers, you can copy a code sample right from our docs and paste it into your terminal to send a ShipEngine API call.

Give it a try with this sample, which returns your most recently created shipping label:

curl -iX GET https://api.shipengine.com/v1/labels?page_size=1 \
-H 'API-Key: __YOUR_API_KEY_HERE__'
  • curl

Note If you've signed-in to ShipEngine, then code samples will include your sandbox API key.
Don't have an API key yet? Go to the ShipEngine dashboard to get one.

Running Curl Examples in Postman

If you're not comfortable using curl in the terminal, or if you just prefer GUI apps instead, then Postman is a great choice. Postman even allows you to import curl commands, so you can copy any curl samples in ShipEngine's documentation (such as the one above) and paste them into Postman.

Step 1: Import Curl

Click the "Import" button in the Postman toolbar to open the Import dialog window.

The "Import" button in Postman

In the Import window, click the "Paste Raw Text" tab, which will show you a large textbox where you can paste a curl command.

Importing a curl command into Postman

After pasting the curl command, click the "Import" button at the bottom of the doalog window, and Postman will automatically convert the curl command into a Postman request.

Step 2: Send the Request

Importing the curl command will create a new Request tab in the main Postman window. The Request will already be filled-in with the URL, headers, query parameters, request body, and other information from the curl command. So all you need to do is click the "Send" button.

The response will be shown on the right-hand side, or on the bottom half of the screen, depending on whether you have Postman configured in a vertical or horizontal layout.

Importing a curl command into Postman