Testing Your APIs & Products

To enable easy testing for yourself and for your users, we recommend creating a Free product with this config:

  • Price: $0/month

  • API Calls: 100

  • Limit Type: HARD

You can sign in using any email on your API store.

To test your product follow these steps:

  1. Login to your API Store User Portal

  2. Click on Products from the Sidebar.

  3. Subscribe to the "FREE" product.

  4. From the list of Endpoints, copy the endpoint you want to call.

  5. Create an API Key by going to the API Keys page from the left sidebar and copy the api key.

  6. To send a request you need to pass the API key in the header as explained below:

Example:

For an endpoint that looks like this, you can send a POST request using any of the methods described below:

Shell

curl --location 'https://api.magicapi.com/api/v1/pipfeed/free_no_card/extract' \
--header 'x-magicapi-key: your-api-key' \
--header 'Content-Type: application/json' \
--data '{
    "url": "https://www.nytimes.com/2023/07/05/world/europe/russia-ukraine-prisoner-interview.html"
}'

Javascript

var myHeaders = new Headers();
myHeaders.append("x-magicapi-key", "your-api-key");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "url": "https://www.nytimes.com/2023/07/05/world/europe/russia-ukraine-prisoner-interview.html"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.magicapi.com/api/v1/pipfeed/free_no_card/extract", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Python

import requests
import json

url = "https://api.magicapi.com/api/v1/pipfeed/free_no_card/extract"

payload = json.dumps({
  "url": "https://www.nytimes.com/2023/07/05/world/europe/russia-ukraine-prisoner-interview.html"
})
headers = {
  'x-magicapi-key': 'your-api-key',
  'Content-Type': 'application/json'
}

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

print(response.text)

You can use tools like Postman to test your API as well:

Last updated