Skip to content

Authentication

The Meedio API uses API keys to authenticate requests. You can view and manage your API keys in the Meedio Dashboard.

Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Your API keys consists of two different keys - public key and secret. The secret key will be revealed only once after it was created and be sure to write it down or you will have to revoke this key.

Once you create the API keys, they will have the expiration date that was selected before creating the keys. We suggest to select "no expire" time when creating unless you have a requirement to rotate your API keys time-by-time.

Authentication to the API is performed via HTTP Headers. Provide your API key as the API_KEY value and API secret as the API_SECRET value.

API keys

Meedio authenticates your API requests using your account’s API keys. If you don’t include your key when making an API request, or use an incorrect or outdated one, Meedio returns a 401 - Unauthorised HTTP response code.

Key examples and description

Key name Example Description
API_KEY 41394730-be53-4e6c-aab7-e38242cad81b This is the main key to access Meedio public API. Making requests with this key will decrease your daily and hourly limits of total issued API requests limit for your account.
API_SECRET cbT75ovrVxVBzweSI7Pll0wbM23yZ4RW This is the authentication key to make your requests to Meedio public API. Meedio does not store this value in the database and encrypts it before issuing it to the developer. After making the request Meedio will compare your sent value with the encrypted one which is stored in our database.

API limits

Meedio have a rate limiter for API requests. Every API access is being limited by specific amount of requests per minute. Once you reach the limit, Meedio returns a 429 - Too Many Requests HTTP response code. We suggest you to calculate how many requests you are going to use and contact help@meedio.me if there is a problem with that.

Requests per minute
1000
Bash
# With shell, you can just pass the correct header with each request
curl --location --request GET 'https://api.meedio.me/api/example-route' \
--header 'API_KEY: meedio_key' \
--header 'API_SECRET: meedio_secret'
Ruby
require "uri"
require "net/http"

url = URI("https://api.meedio.me/api/example-route")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["API_SECRET"] = "meedio_secret"
request["API_KEY"] = "meedio_key"

response = https.request(request)
puts response.read_body
JavaScript
var axios = require("axios");

var config = {
  method: "get",
  url: "https://api.meedio.me/api/example-route",
  headers: {
    API_SECRET: "meedio_secret",
    API_KEY: "meedio_key",
  },
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
Python
import requests

url = "https://api.meedio.me/api/example-route"

payload={}
headers = {
  'API_SECRET': 'meedio_secret',
  'API_KEY': 'meedio_key'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
PHP
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.meedio.me/api/example-route');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'API_SECRET' => 'meedio_secret',
  'API_KEY' => 'meedio_key'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
Go
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.meedio.me/api/example-route"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("API_SECRET", "meedio_secret")
  req.Header.Add("API_KEY", "meedio_key")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Tip

Make sure to replace meedio_key with your API key and meedio_secret with your API secret.