MagicAPI
MagicAPI
  • 👋Welcome to MagicAPI
  • Overview
    • Creating an API Store
    • Importing an API Source
    • Creating a Product using the Wizard
    • User Portal
    • Testing Your APIs & Products
    • Analytics & Logs
    • Configure Custom DNS for your API Store
    • Custom Usage
  • Concepts
    • Understanding Products
    • API Keys
  • Fundamentals
    • Convert Postman Collection to OpenAPI Yaml
    • Create OpenAPI spec using ChatGPT
  • API Providers
    • Toon Me API
    • Advanced Toon Me API
  • About Us
Powered by GitBook
On this page

Was this helpful?

  1. Overview

Testing Your APIs & Products

PreviousUser PortalNextAnalytics & Logs

Last updated 1 year ago

Was this helpful?

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:

PostMan request for MagicAPI