The Plan

This guide shows how to make a simple dig IP address lookup request using resources from the Akamai Intelligent Platform™. First, the client requests the locations in the Akamai network that are capable of running the dig utility. The app will then selects a location from the response and submit a dig request to get the IP address information for

API Call Sequence

  • GET /diagnostic-tools/v1/locations
  • GET /diagnostic-tools/v1/dig?hostname={hostname}&location={location}&queryType={queryType}

You can view the documentation for the diagnostic-tools API to get more information and to see other tools that it exposes.

Making API Calls

During the previous steps, you authorized and configured credentials for the diagnostic tools utility. During this step you will make calls to this API.

API Calls


If you chose to set up HTTPie during the initial setup, you can make calls directly to the API once you have satisfied the prerequisites above.

Making a call with HTTPie is simple. The instructions are the same however you set it up.

We’ll start with the locations call:

$ http --auth-type edgegrid -a default: :/diagnostic-tools/v1/locations

Next, let’s make a call to the dig command itself. In this case we need to set some query parameters as shown in the diagnostic-tools documentation.

$ http --auth-type edgegrid -a default: :/diagnostic-tools/v1/dig queryType==A location=="Tokyo, Japan"

Using Sample Code

To use the sample code, let’s run the application.

You should be in the same directory you used for Setup Your Environment and Configure your Credentials.

Run the script:

$ python

Requesting locations that support the diagnostic-tools API.

There are 62 locations that can run dig in the Akamai Network
We will make our call from Mountprospect, United States

Running dig from Mountprospect, United States

; <<>> DiG 9.8.1-P1 <<>> -t A

;; Query time: 209 msec
;; WHEN: Wed Sep 24 20:04:58 2014
;; MSG SIZE  rcvd: 304


Analyzing the Results

The first call the application makes is to the /diagnostic-tools/v1/locations resource which returns a JSON object containing a list of Akamai locations that can run the diagnostic-tools API.

  "locations": [
    "Miami, United States",
    "Oakbrook, United States"
  "errorString": null

It then randomly selects a location from this list and submits a GET request to the /diagnostic-tools/v1/dig resource. The dig results come back in another JSON object:

  "dig": {
    "authoritySection": [
        "preferenceValues": null,
        "domain": "",
        "recordType": "NS",
        "value": "",
        "ttl": "7200",
        "recordClass": "IN"
    "errorString": null,
    "hostname": "",
    "result": "\n; <<>> DiG 9.8.1-P1 <<>> -t A\n;; global options: +cmd\n;; Got answer:\n;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5665\n;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 8, ADDITIONAL: 0\n\n;; QUESTION SECTION:\n;\t\tIN\tA\n\n;; ANSWER SECTION:\\t300\tIN\tCNAME\\ 21600\tIN CNAME\ 20\tIN\tA\t23.58.155.95\n\n;; AUTHORITY SECTION:\\t7200\tIN\tNS\\\t7200\tIN\tNS\\\t7200\tIN\tNS\\\t7200\tIN\tNS\\\t7200\tIN\tNS\\\t7200\tIN\tNS\\\t7200\tIN\tNS\\\t7200\tIN\tNS\\n\n;; Query time: 140 msec\n;; SERVER:\n;; WHEN: Wed Sep 24 20:03:40 2014\n;; MSG SIZE  rcvd: 304\n\n",
    "answerSection": [
        "preferenceValues": null,
        "domain": "",
        "recordType": "A",
        "value": "",
        "ttl": "20",
        "recordClass": "IN"
    "queryType": "A"


You’ve completed your first Akamai OPEN API call! Now you are ready to explore more of the APIs offered in the OPEN API Catalog.

Now What?

We’ve taken you through the basics, now it’s your turn. Here are some suggestions:

  • Extend the sample client to suit your needs—perhaps implement mtr functionality into
  • Download an open source OPEN API Client that matches your preferred development language.
  • Explore the APIs available in the Akamai OPEN API Catalog.
  • Discuss your results in the Akamai Developer Community.
  • Contribute to the Akamai API ecosystem.