Skip to content

MSP Panel Blog · Updated November 2026

How to Use an SMM Panel API (PHP and Python Examples)

An SMM panel API lets your own website or script place and track orders automatically. MSP Panel offers SMM API v2 at https://msp-panel.com/api/v2 over HTTP POST with JSON responses, covering services, orders, status, refills and balance. You only need your API key.

By MSP Panel TeamUpdated 8 min readGuides

What an SMM panel API does

Placing orders by hand works when you handle ten a day. When you run a website, an app or a reseller business, you want orders to flow without anyone copying links into a form. That is the job of an API.

An API (application programming interface) is a set of rules your code follows to talk to the panel. Your script sends a request, the panel replies with data, and your system acts on it. If you are new to panels in general, read our guide on what an SMM panel is first.

Typical uses in 2027 include:

  • Connecting a reseller website so customer orders reach the panel automatically.
  • Building a child panel with your own domain and your own prices.
  • Running a bot or internal tool that places orders and checks their status.
  • Syncing the service list into your own catalogue.

The full public reference lives on the MSP Panel API page. This guide shows how the pieces fit together with working code.

Before you start: key, endpoint and balance

You need three things before the first request.

  1. An account. Create a free account. Signing up costs nothing.
  2. Your API key. After signup, open the Account page in the dashboard. Your key is shown there.
  3. Wallet balance. Orders are paid from your balance, so add funds first. UPI deposits can start from ₹50 on UPI gateways, and the full list is on the payment methods page.

The endpoint is the same for every action: https://msp-panel.com/api/v2. Every call is an HTTP POST, and the panel answers in JSON. You choose what you want by sending an action parameter along with your key.

Treat your key like a password. Anyone who has it can spend your balance. We come back to this in the best practices section.

API v2 actions at a glance

MSP Panel SMM API v2 supports seven actions. The parameter names below follow the standard SMM panel API v2 format, so most existing scripts and reseller scripts work with little change. Always confirm the exact fields on the API page before you go live.

ActionWhat it doesMain parameters
servicesReturns the full service list with rates, minimum and maximumkey, action
addPlaces a new order and returns the order IDkey, action, service, link, quantity
statusReturns the status of one orderkey, action, order
multiple statusReturns the status of many orders in one callkey, action, orders (comma separated IDs)
create refillRequests a refill on an eligible completed orderkey, action, order
refill statusChecks the progress of a refill requestkey, action, refill
balanceReturns your current wallet balancekey, action

For services that support it, such as drip-feed delivery, extra fields like runs and interval are sent along with the add action. Our drip-feed guide explains what those values mean.

Code examples: PHP (cURL) and Python (requests)

PHP (cURL): place an order

This PHP script wraps the request in one reusable function, so every action uses the same code. Replace YOUR_API_KEY and SERVICE_ID with your own values. The service ID comes from the service list or from the ID column on the Services page.

<?php
$apiUrl = 'https://msp-panel.com/api/v2';
$apiKey = 'YOUR_API_KEY';

function mspRequest($apiUrl, array $fields)
{
    $ch = curl_init($apiUrl);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 30);

    $body = curl_exec($ch);
    if ($body === false) {
        $error = curl_error($ch);
        curl_close($ch);
        return ['error' => 'Network error: ' . $error];
    }
    curl_close($ch);

    $data = json_decode($body, true);
    return $data === null ? ['error' => 'Invalid JSON response'] : $data;
}

// 1. Place an order
$result = mspRequest($apiUrl, [
    'key'      => $apiKey,
    'action'   => 'add',
    'service'  => 'SERVICE_ID',
    'link'     => 'https://www.instagram.com/p/EXAMPLE/',
    'quantity' => 1000,
]);

if (isset($result['order'])) {
    echo 'Order placed: ' . $result['order'];
} else {
    echo 'Failed: ' . ($result['error'] ?? 'Unknown error');
}

Notice that the function returns an array with an error key when something breaks. This keeps the rest of your code simple, because you always check one thing.

Python (requests): balance, order and status

The same flow in Python uses the requests library. Install it with pip install requests if you do not have it.

import requests

API_URL = "https://msp-panel.com/api/v2"
API_KEY = "YOUR_API_KEY"

def msp_request(payload):
    payload["key"] = API_KEY
    try:
        response = requests.post(API_URL, data=payload, timeout=30)
        response.raise_for_status()
        return response.json()
    except requests.RequestException as exc:
        return {"error": "Network error: " + str(exc)}
    except ValueError:
        return {"error": "Invalid JSON response"}

# 1. Check your balance
print(msp_request({"action": "balance"}))

# 2. Place an order
result = msp_request({
    "action": "add",
    "service": "SERVICE_ID",
    "link": "https://www.instagram.com/p/EXAMPLE/",
    "quantity": 1000,
})

if "order" in result:
    print("Order placed:", result["order"])
else:
    print("Failed:", result.get("error", "Unknown error"))

# 3. Check order status
print(msp_request({"action": "status", "order": result.get("order")}))

The timeout matters. Without it, a slow network can freeze your script. Thirty seconds is a sensible starting point.

Reading the JSON responses

The panel replies in JSON, so you can parse it with json_decode in PHP or response.json() in Python. The samples below are examples only. Your real values, field names and order IDs will differ, so always check the live response.

A successful add call returns the new order ID:

{"order": 12345}

A status call returns the order state. Save the order ID in your own database so you can look it up later:

{"charge": "0.27819", "start_count": "3572", "status": "In progress", "remains": "157", "currency": "INR"}

A services call returns a list. This is an example of a single entry:

[{"service": 1, "name": "Example service", "type": "Default", "category": "Example category", "rate": "0.90", "min": "50", "max": "10000", "refill": true, "cancel": false}]

Use the minimum and maximum from the list to validate quantities before you send them. It saves failed requests and keeps your customers from seeing confusing errors.

Tracking orders, multiple status and refills

Once orders are running, you will mostly use three actions.

  • status for a single order, useful on a customer's order page.
  • multiple status to refresh many orders in one request. This is far better than calling status in a loop, especially if you have hundreds of open orders.
  • create refill and refill status for services that carry a refill period.

Refill is only available on services that offer it. Periods in service names range from 7 to 365 days, and not every listing has one. Read the service name and the Details text before you sell it to a customer. Our article on SMM quality tags explains how to read them, and the refill policy covers the rules.

A good habit is to poll order status every few minutes rather than every few seconds. Orders show an average completion time on each service, so there is no benefit in checking more often.

Simple error handling that saves money

Most API problems are small and predictable. Handle these four cases and your integration will be solid.

  1. Network failure. The request never reached the panel. Retry after a short wait, but check your order list first so you do not place a duplicate.
  2. Invalid JSON. Log the raw response and stop. Do not guess.
  3. An error message in the reply. Typical causes are a wrong key, a wrong service ID, a quantity outside the minimum and maximum, or low balance. Show a friendly message to your user and log the details.
  4. Wrong link. Only public links work. Private accounts and misplaced links do not qualify for refund credit, as the Terms explain.

Never retry an add call blindly in a loop. If the first attempt actually succeeded, you will place the same order twice, and orders cannot be cancelled or refunded after they are placed.

API best practices for 2027

These habits keep your integration fast, cheap and safe.

  • Cache the service list. Rates and services change rarely during a day. Fetch the list once every few hours, store it, and serve your site from the cache.
  • Never expose the key. Keep it in a server-side environment variable. Do not put it in front-end JavaScript, mobile app code or a public repository.
  • Check balance before big batches. Call balance first so a bulk run does not fail halfway.
  • Validate input. Check link format and quantity against the service minimum and maximum before calling add.
  • Store every order ID. You need it for status, refill and support. If you ever write to support, the order ID is the first thing asked.
  • Use multiple status. Batch your checks to reduce load.
  • Do not use two servers for the same page. Counts become wrong and are not refunded.

Finally, test with a small order on a low-priced service. Rates start from ₹0.18 per 1,000 for some listings, so a test costs very little. Live prices are always on the Services page.

Using the API for resellers and child panels

If you run your own storefront, the API is how your prices and services connect to ours. You import the service list, add your own margin, and let your customers order from your site. Your margin depends entirely on the prices you choose.

Two paths are common. A reseller panel setup suits people who want to sell through MSP Panel directly. A child panel suits those who want a branded site on their own domain that connects through the API. To compare the two approaches, read child panel vs SMM script.

MSP Panel serves 1,000+ resellers and has delivered more than 10 million orders since 2017. Ready to build? Create your account, copy your key from the Account page, and run the balance call from the examples above. If it returns a number, you are connected.

Frequently asked questions

What is the MSP Panel API endpoint?

The endpoint is https://msp-panel.com/api/v2. Every request is an HTTP POST and responses come back as JSON. You send your API key and an action such as services, add, status, multiple status, create refill, refill status or balance with each call.

Where do I find my API key?

Create an account on MSP Panel, sign in and open the Account page. Your API key is shown there. Keep it private and store it on the server side, because anyone with the key can place orders using your balance.

Which programming languages can I use?

Any language that can send an HTTP POST request and read JSON will work. This guide shows PHP with cURL and Python with requests, but the same approach works in Node.js, Java, C#, Go and others. Choose whichever language your project already uses.

Can I cancel an order through the API?

The listed actions are services, add, status, multiple status, create refill, refill status and balance. Under the Terms, orders cannot be refunded or cancelled after they are placed, so check the link, service and quantity carefully before every add call.

How often should I refresh the service list?

Caching the list for a few hours is usually enough, because services and rates do not change every minute. Refresh it on a schedule, and always validate quantity against the minimum and maximum. Live prices are on the Services page.

Keep reading

Ready to try MSP Panel?

Create your free account in under a minute and start with a small order. Live prices are on the Services page.

More guides on the MSP Panel blog · Back to the SMM Panel India homepage.