Back to top

Medias API

The main purpose of this API is to retrieve medias.

The production url for this API is https://nap.launchmetrics.com/medias/v1

Authentication

All apis contain the /v[:version] placeholder. It’s used to do API versioning

  • v0 For testing environments, no authentication is required and it’s disabled on production

  • v1 Production version, authentication required

There are two ways to authenticate the request

  • with just an app_id parameter (if you don’t have an app_id you should request one) (less secure)

  • with an app_id + signature parameters (signature creation explained below) (more secure)

The use of appId or appid is deprecated, use app_id instead

The testing environment is not up 24/7, so some calls to the testing urls may return 404

Create a signature

This method is inspired from https://dev.twitter.com/docs/auth/creating-signature

To sign a request you need:

  • http method in uppercase: GET, POST

  • Request url without parameters

  • The parameter string, a url-encoded and sorted parameters string (see below to know how to generate it)

  • Body bytes content, if you’re not sending form data

  • Current timestamp (in seconds)

  • A nonce, in other words, a random string which have at least 32 characters

  • An app_id provided by R&D

  • A secret (related to the app) provided by R&D

For example, given this parameters as key and values:

{ “query”: “girona”, "period: “last_month”, }

Step 1, add the timestampp, nonce and app_id:

{ “query”: “girona”, “period”: “last_month”, “timestamp”: “1380545928”, “nonce”: “QC3hTWyVby6PtKKeCnxPAEMPXebUP82D”, “app_id”: “3ttp2946sij2hic” }

Step 2, percent encode all keys and values

{ “query”: “girona”, “period”: “last_month”, “timestamp”: “1380545928”, “nonce”: “QC3hTWyVby6PtKKeCnxPAEMPXebUP82D”, “app_id”: “3ttp2946sij2hic” }

Make sure your percent encode library encode spaces as %20 instead of +. Using the + sign will generate an incorrect signature.

Step 3, join the key and value using a = and sort the parameters alphabetically

[ “app_id=3ttp2946sij2hic”, “nonce=QC3hTWyVby6PtKKeCnxPAEMPXebUP82D”, “period=last_month”, “query=girona”, “timestamp=1380545928” ]

Step 4, join all parameters with & to generate the parameter_string

app_id=3ttp2946sij2hic&nonce=QC3hTWyVby6PtKKeCnxPAEMPXebUP82D&period=last_month&query=girona&timestamp=1380545928

Step 5, generate the signature_base string using this schema

signature_base = http_method&url_encoded(request_url)&url_encoded(parameter_string)

Step 6, if you’re sending not form data on body(p.e. a json or plain text), add body bytes after a new line

signature_base = signature_base + “\n” + ‘{“json”: “example”}’

where

  • http_method is the http method used for the request in uppercase: GET

  • request_url is the url without parameters and without the protocol, for example nap.aws.augure.com/v1/search/influencers

  • parameter_string is explained above, for example app_id=3ttp2946sij2hic&nonce=QC3hTWyVby6PtKKeCnxPAEMPXebUP82D&period=last_month&query=girona&timestamp=1380545928

Then the signature_base string will be:

GET&nap.aws.augure.com%2Fv1%2Fsearch%2Finfluencers&app_id%3D3ttp2946sij2hic%26nonce%3DQC3hTWyVby6PtKKeCnxPAEMPXebUP82D%26period%3Dlast_month%26query%3Dgirona%26timestamp%3D1380545928 {“json”: “example”}

don’t forget to url_encode the request_url and the parameter_string

Step 6, generate the signature parameter using the HMAC_SHA1 algorithm. This algorithm needs 2 strings to work, the first one will be the signature_base string, and the second one will be the secret (needed to generate the secure hash).

The output of this algorithm is binary, so you should use base64 encoding to produce the final signature string.

If the secret provided for our app is rpii62atrbqejx27v7uv32qbn8exv7gj then the signature of our request will be

OHQRsFL3dqFIStxxHcv1yY8qcy4=

Step 7, add the signature value to the request parameters and execute the request to the API. In this case will be

{ “query”: “girona”, “period”: “last_month”, “nonce”: “QC3hTWyVby6PtKKeCnxPAEMPXebUP82D”, “timestamp”: “1380545928”, “app_id”: “3ttp2946sij2hic”, “signature”: “OHQRsFL3dqFIStxxHcv1yY8qcy4=” }

Don’t forget, if you’re not using a helper library, you should url encode all keys and values.

For the POST and PUT requests which you’re not sending form data, like a json or plain text, the parameters related to the signature must be added to the url, p.e.: https://nap.launchmetrics.com/v1/analysis?app_id=xxx&nonce=xxx&timestamp=xxx&signature=xxx

Response

All responses return application/json; charset=utf-8.

  • Response ok (application/json)

    The response element will contain the specific API method response.

    {
            "status": "200",
            "time": "0.2",
            "request": {
              "method":"GET",
              "path":"/ping",
              "parameters": {}
          },
          "response": {}
        }
  • Response error (application/json)

    There could be different messages with the correspondent HTTP error code.

    {
            "status": "404",
            "time": "0.2",
            "request": {
              "method":"GET",
              "path":"/ping",
              "parameters": {}
          },
          "error": {
            "code": "WRONG_PARAMETERS",
            "message": "The email parameter is mandatory"
          }
        }

Generic Error codes

  • Http status 400

    • MISSING_PARAMETERS

      Some error with the API parameters

  • Http status 500

    • INTERNAL_ERROR

      Unexpected API error

API Health

There are two default methods available for each API for monitoring purposes.

Ping

Ping
GET/ping

Used to know if the API is up and working

Example URI

GET https://nap.launchmetrics.com/medias/v1/ping
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "pong": "ok"
}

Stats

Stats
GET/stats

It displays information about the API usage and how it performs

Example URI

GET https://nap.launchmetrics.com/medias/v1/stats
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "last24hours": {
    "GET /emailValidation/v1/setEmailStatus": {
      "hour_interval": [
        {
          "hour": "2016-02-18T16:00:00.000Z",
          "count": 2,
          "variance": 0,
          "status": {
            "EMAIL_NOT_FOUND": {
              "count": 2,
              "variance": 0,
              "std_deviation": 0,
              "avg": 0.168862000107765,
              "min": 0.168862000107765,
              "max": 0.168862000107765,
              "sum_of_squares": 0.0570287501607898,
              "std_deviation_bounds": {
                "upper": 0.168862000107765,
                "lower": 0.168862000107765
              },
              "sum": 0.33772400021553
            },
            "OK": {
              "count": 0,
              "variance": null,
              "std_deviation": null,
              "avg": null,
              "min": null,
              "max": null,
              "sum_of_squares": null,
              "std_deviation_bounds": {
                "upper": null,
                "lower": null
              },
              "sum": null
            }
          },
          "min": 0.168862000107765,
          "avg": 0.168862000107765,
          "std_deviation": 0,
          "max": 0.168862000107765,
          "sum_of_squares": 0.0570287501607898,
          "sum": 0.33772400021553,
          "std_deviation_bounds": {
            "upper": 0.168862000107765,
            "lower": 0.168862000107765
          }
        },
        {
          "hour": "2016-02-18T18:00:00.000Z",
          "count": 2,
          "variance": 0,
          "status": {
            "EMAIL_NOT_FOUND": {
              "count": 2,
              "variance": 0,
              "std_deviation": 0,
              "avg": 0.0233999993652105,
              "min": 0.0233999993652105,
              "max": 0.0233999993652105,
              "sum_of_squares": 0.00109511994058371,
              "std_deviation_bounds": {
                "upper": 0.0233999993652105,
                "lower": 0.0233999993652105
              },
              "sum": 0.0467999987304211
            },
            "OK": {
              "count": 0,
              "variance": null,
              "std_deviation": null,
              "avg": null,
              "min": null,
              "max": null,
              "sum_of_squares": null,
              "std_deviation_bounds": {
                "upper": null,
                "lower": null
              },
              "sum": null
            }
          },
          "min": 0.0233999993652105,
          "avg": 0.0233999993652105,
          "std_deviation": 0,
          "max": 0.0233999993652105,
          "sum_of_squares": 0.00109511994058371,
          "sum": 0.0467999987304211,
          "std_deviation_bounds": {
            "upper": 0.0233999993652105,
            "lower": 0.0233999993652105
          }
        },
        {
          "hour": "2016-02-18T20:00:00.000Z",
          "count": 2,
          "variance": 0,
          "status": {
            "EMAIL_NOT_FOUND": {
              "count": 2,
              "variance": 0,
              "std_deviation": 0,
              "avg": 0.0268389992415905,
              "min": 0.0268389992415905,
              "max": 0.0268389992415905,
              "sum_of_squares": 0.00144066376058019,
              "std_deviation_bounds": {
                "upper": 0.0268389992415905,
                "lower": 0.0268389992415905
              },
              "sum": 0.053677998483181
            },
            "OK": {
              "count": 0,
              "variance": null,
              "std_deviation": null,
              "avg": null,
              "min": null,
              "max": null,
              "sum_of_squares": null,
              "std_deviation_bounds": {
                "upper": null,
                "lower": null
              },
              "sum": null
            }
          },
          "min": 0.0268389992415905,
          "avg": 0.0268389992415905,
          "std_deviation": 0,
          "max": 0.0268389992415905,
          "sum_of_squares": 0.00144066376058019,
          "sum": 0.053677998483181,
          "std_deviation_bounds": {
            "upper": 0.0268389992415905,
            "lower": 0.0268389992415905
          }
        }
      ],
      "count": 2068,
      "variance": 0.952526547318981,
      "min": 18.1012001037598,
      "avg": 19.8605297686284,
      "std_deviation": 0.975974665305909,
      "max": 23.6008319854736,
      "sum_of_squares": 817673.073983961,
      "std_deviation_bounds": {
        "upper": 21.8124790992402,
        "lower": 17.9085804380165
      },
      "sum": 41071.5755615234
    }
  },
  "last15days": {
    "GET /emailValidation/v1/setServerEmailsVerificationPending": {
      "count": 1,
      "variance": 0,
      "min": 28.7900829315186,
      "avg": 28.7900829315186,
      "std_deviation": 0,
      "max": 28.7900829315186,
      "sum_of_squares": 828.868875203716,
      "day_interval": [
        {
          "count": 1,
          "variance": 0,
          "status": {
            "CONNECTION_ERROR": {
              "count": 1,
              "variance": 0,
              "std_deviation": 0,
              "avg": 28.7900829315186,
              "min": 28.7900829315186,
              "max": 28.7900829315186,
              "sum_of_squares": 828.868875203716,
              "std_deviation_bounds": {
                "upper": 28.7900829315186,
                "lower": 28.7900829315186
              },
              "sum": 28.7900829315186
            },
            "OK": {
              "count": 0,
              "variance": null,
              "std_deviation": null,
              "avg": null,
              "min": null,
              "max": null,
              "sum_of_squares": null,
              "std_deviation_bounds": {
                "upper": null,
                "lower": null
              },
              "sum": null
            }
          },
          "min": 28.7900829315186,
          "avg": 28.7900829315186,
          "std_deviation": 0,
          "max": 28.7900829315186,
          "sum_of_squares": 828.868875203716,
          "day": "2016-02-07T00:00:00.000Z",
          "sum": 28.7900829315186,
          "std_deviation_bounds": {
            "upper": 28.7900829315186,
            "lower": 28.7900829315186
          }
        }
      ],
      "std_deviation_bounds": {
        "upper": 28.7900829315186,
        "lower": 28.7900829315186
      },
      "sum": 28.7900829315186
    }
  }
}

Custom error codes

Http status 400

  • MEDIA_INVALID_IDS

    Ids passed to api are not corrects.

Http status 500

  • MEDIA_LOAD_ERROR

    The load process has failed.

Online Medias Collection

Media retrieval

Medias
GET/medias/{ids}

Method used to get medias data.

If you want to retrieve a lot of medias, please use the next method instead

Example URI

GET https://nap.launchmetrics.com/medias/v1/medias/968427630
URI Parameters
HideShow
ids
number (required) Example: 968427630

The medias ids you want to retrieve. It can be one or more separated by comas.

If one or more of these medias aren’t in our database, it won’t be returned

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "typology": {
      "name": "Online Media",
      "id": "0"
    },
    "location": {
      "country": {
        "name": "Spain",
        "id": "0100",
        "code": "ES"
      },
      "continent": {
        "name": "Europe",
        "id": "01"
      },
      "region": {
        "name": "Catalonia",
        "id": "010001"
      },
      "subregion": {
        "name": "Barcelona",
        "id": "01000102"
      }
    },
    "language": {
      "name": "spanish",
      "id": "0",
      "code": "es"
    },
    "average_daily_saved_articles": "5091.1290",
    "status": "1",
    "agency_id": null,
    "origin": "imente",
    "description": "Publicación generalista con noticias de actualidad",
    "generic_email": "redaccion@lavanguardia.es",
    "is_in_google_news": "YES",
    "searchers": [
      "LaVanguardia.es",
      "http://www.lavanguardia.es",
      "http://blogs.lavanguardia.com",
      "http://juegosolimpicos.lavanguardia.com",
      "http://endirecto.lavanguardia.com",
      "http://www.lavanguardia.com/alminuto",
      "http://www.lavanguardia.com/local/aragon.html",
      "http://www.lavanguardia.com/local/valles-occidental.html",
      "http://www.lavanguardia.com",
      "http://www.lavanguardia.com/index.html",
      "http://www.lavanguardia.com/cultura",
      "http://www.lavanguardia.com/index.html",
      "http://www.lavanguardia.mobi"
    ],
    "url": "http://www.lavanguardia.com",
    "id": "968427630",
    "title": "La Vanguardia",
    "has_favicon": true,
    "rank": {
      "alexa_inlinks_host_match": "1",
      "alexa_rank": "2125",
      "google_pagerank": "7",
      "alexa_reach": "678.0000",
      "audience": "1968845",
      "audience_mode": "ALEXA_REACH",
      "alexa_inlinks": "13135",
      "google_inlinks": "1020",
      "source_rank": "89252",
      "advertising_value": "24611",
      "alexa_page_views": "2.5000",
      "similarweb_monthly_visits": "25611756.0000",
      "similarweb_updated_at": "2019-02-11 00:28:19",
      "similarweb_applied_correction": "none"
    },
    "inserted_at": "2000-09-08T17:40:30Z"
  }
]

Medias
POST/medias/

Same as the previous call, but the ids are sent with the request message body.

Example URI

POST https://nap.launchmetrics.com/medias/v1/medias/
Request
HideShow
Headers
Content-Type: text/plain
Body
967823904,968325673,995640653,1011612417
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "typology": {
      "name": "Corporate/Institucional",
      "id": "4"
    },
    "average_daily_saved_articles": "47.6129",
    "status": "1",
    "searchers": [],
    "agency_id": null,
    "modified_at": "2015-06-14T15:22:43Z",
    "url": "http://www.acb.com",
    "id": "967823904",
    "inserted_at": "2000-09-01T17:58:24Z",
    "language": {
      "name": "spanish",
      "id": "0",
      "code": "es"
    },
    "location": {
      "country": {
        "name": "Spain",
        "id": "0100",
        "code": "ES"
      },
      "continent": {
        "name": "Europe",
        "id": "01"
      },
      "region": {
        "name": "Catalonia",
        "id": "010001"
      },
      "subregion": {
        "name": "Barcelona",
        "id": "01000102"
      }
    },
    "origin": "imente",
    "description": "Web oficial de l\\\\\\\\\\\\\\\\\\\\'ACB. (Baloncesto)",
    "generic_email": "",
    "is_in_google_news": "YES",
    "title": "ACB.COM",
    "has_favicon": false,
    "rank": {
      "alexa_inlinks_host_match": "1",
      "alexa_rank": "15852",
      "google_pagerank": "5",
      "alexa_reach": "82.0000",
      "audience": "174268",
      "audience_mode": "ALEXA_REACH",
      "alexa_inlinks": "1245",
      "google_inlinks": "208",
      "source_rank": "53631",
      "advertising_value": "4688",
      "alexa_page_views": "5.3800",
      "similarweb_monthly_visits": "1861156.0000",
      "similarweb_updated_at": "2019-02-11 00:28:19",
      "similarweb_applied_correction": "10"
    }
  },
  {
    "typology": {
      "name": "Online Media",
      "id": "0"
    },
    "average_daily_saved_articles": "681.3214",
    "status": "1",
    "searchers": [
      "http://www.elmundodeportivo.es"
    ],
    "agency_id": null,
    "modified_at": "2016-01-11T12:28:14Z",
    "url": "http://www.mundodeportivo.com",
    "id": "968325673",
    "inserted_at": "2000-09-07T13:21:13Z",
    "language": {
      "name": "spanish",
      "id": "0",
      "code": "es"
    },
    "location": {
      "country": {
        "name": "Spain",
        "id": "0100",
        "code": "ES"
      },
      "continent": {
        "name": "Europe",
        "id": "01"
      },
      "region": {
        "name": "Catalonia",
        "id": "010001"
      },
      "subregion": {
        "name": "Barcelona",
        "id": "01000102"
      }
    },
    "origin": "twingly_no_capturar",
    "description": "",
    "generic_email": "redaccion@mundodeportivo.com",
    "is_in_google_news": "YES",
    "title": "Mundo Deportivo",
    "has_favicon": true,
    "rank": {
      "alexa_inlinks_host_match": "1",
      "alexa_rank": "2100",
      "google_pagerank": "6",
      "alexa_reach": "696.0000",
      "audience": "2110735",
      "audience_mode": "ALEXA_REACH",
      "alexa_inlinks": "2893",
      "google_inlinks": "368",
      "source_rank": "78668",
      "advertising_value": "25012",
      "alexa_page_views": "2.3700",
      "similarweb_monthly_visits": "611756.0000",
      "similarweb_updated_at": "2019-02-11 00:28:19",
      "similarweb_applied_correction": "none"
    }
  },
  {
    "typology": {
      "name": "Online Media",
      "id": "0"
    },
    "average_daily_saved_articles": "996.4839",
    "status": "1",
    "searchers": [
      "travel.nytimes.com",
      "movies.nytimes.com",
      "takingnote.blogs.nytimes.com",
      "opinionator.blogs.nytimes.com",
      "dealbook.nytimes.com",
      "realestate.nytimes.com",
      "tv.nytimes.com",
      "theater.nytimes.com",
      "topics.nytimes.com",
      "wheels.blogs.nytimes.com",
      "http://dealbook.blogs.nytimes.com",
      "http://global.nytimes.com"
    ],
    "agency_id": null,
    "modified_at": "2016-01-11T12:28:18Z",
    "url": "http://www.nytimes.com",
    "id": "995640653",
    "inserted_at": "2001-07-20T16:50:53Z",
    "language": {
      "name": "english",
      "id": "2",
      "code": "en"
    },
    "location": {
      "country": {
        "name": "USA",
        "id": "0400",
        "code": "US"
      },
      "continent": {
        "name": "North America",
        "id": "04"
      },
      "region": {
        "name": "New York",
        "id": "040012"
      }
    },
    "origin": "imente",
    "description": "Principal diari de New york\r\n",
    "generic_email": "",
    "is_in_google_news": "YES",
    "title": "The New York Times",
    "has_favicon": true,
    "rank": {
      "alexa_inlinks_host_match": "1",
      "alexa_rank": "111",
      "google_pagerank": "9",
      "alexa_reach": "11320.0000",
      "audience": "30544139",
      "audience_mode": "ALEXA_REACH",
      "alexa_inlinks": "414195",
      "google_inlinks": "6020",
      "source_rank": "100000",
      "advertising_value": "365002",
      "alexa_page_views": "2.3900",
      "similarweb_monthly_visits": "18622756.0000",
      "similarweb_updated_at": "2019-02-11 00:28:19",
      "similarweb_applied_correction": "1"
    }
  },
  {
    "typology": {
      "name": "Online Media",
      "id": "0"
    },
    "average_daily_saved_articles": "2.5000",
    "status": "1",
    "searchers": [
      "http://www.thesun.co.uk/sol/homepage/"
    ],
    "agency_id": null,
    "modified_at": "2016-01-11T12:28:20Z",
    "url": "http://www.thesun.co.uk",
    "id": "1011612417",
    "inserted_at": "2002-01-21T12:26:57Z",
    "language": {
      "name": "english",
      "id": "2",
      "code": "en"
    },
    "location": {
      "country": {
        "name": "United Kingdom",
        "id": "0103",
        "code": "GB"
      },
      "continent": {
        "name": "Europe",
        "id": "01"
      }
    },
    "origin": "imente",
    "description": "Rotativo sensacionalista inglés",
    "generic_email": null,
    "is_in_google_news": "YES",
    "title": "The Sun",
    "has_favicon": false,
    "rank": {
      "alexa_inlinks_host_match": "1",
      "alexa_rank": "6589",
      "google_pagerank": "7",
      "alexa_reach": "260.0000",
      "audience": "610390",
      "audience_mode": "ALEXA_REACH",
      "alexa_inlinks": "20962",
      "google_inlinks": "952",
      "source_rank": "71122",
      "advertising_value": "5860",
      "alexa_page_views": "1.9200",
      "similarweb_monthly_visits": "18611756.0000",
      "similarweb_updated_at": "2019-02-10 00:28:19",
      "similarweb_applied_correction": "10"
    }
  }
]

Generated by aglio on 24 Aug 2026