[HTTPie](🔗) is a simple command-line client you can use to make Akamai API calls.

Akamai Docker Development Environment

We've bundled several tools together, including `HTTPie`, to make it easier for you to start testing Akamai APIs. Check out the [Docker](🔗) section for more information.

If you prefer to use HTTPie standalone, follow these steps.

## Install HTTPie

To simplify the install process, you can use `pip`. It works on Linux, macOS, and Windows, and always provides the latest version of HTTPie. `pip` is already installed on Python v3.6 or later. You can download the latest version from [python.org](🔗).

  1. Run the command for your operating system to verify that `pip` is installed:

    • **Linux or macOS**

    
    • **Windows**

    
  2. Run the command for your operating system to install HTTPie and upgrade it to the most recent version:

    • **Linux or macOS** `$ python -m pip install --upgrade httpie`

    • **Windows** `C:\> py -m pip install --upgrade httpie`

  3. Run this command to install the `httpie-edgegrid` plugin. This is necessary to authenticate API calls. It's already included in the `pip` repo, so you can quickly install it.

    
  4. Run this command to verify the installation and check the version:

    

## Authenticate

If you haven't already, you'll need to [Create authentication credentials](🔗).

The `httpie-edgegrid` plugin relies on an `.edgerc` file to authenticate requests. If you need help setting up your `.edgerc` file, refer to [Add credential to .edgerc file](🔗).

## Make API calls with HTTPie

Once you've set up EdgeGrid authentication, you can make API calls with HTTPie.

HTTPie follows a generic path to authenticate and make requests to Akamai APIs:


  • `auth-type=edgegrid`. Tells the request to use `edgegrid` for authentication.

  • `-a default`. Tells the request to reference the `[default]` section of your `.edgerc` file for credentials.

  • `{akamai-api-endpoint}`. This endpoint corresponds to the specific API operation you want to call. You can find a list and explanation of available endpoints in the [API documentation](🔗).

In this exercise, you'll use HTTPie to look up an IP address with the [Edge Diagnostics API](🔗).

  1. Request the locations of servers in the Akamai network that can run the diagnostic tools.

    

    The `200 OK` response shows the location results:

    
  2. [Request IP address information](🔗) for Perth, WA, Australia, using the specific `id` from the previous call, `perth-wa-australia`.

    

    The `200 OK` response shows location-specific results:

    

## Video demo

Here's a video demonstration of the process to make API calls with HTTPie.

(Script tags will be stripped)