API code examples
Run the cURL line first and watch the API answer in your terminal. Then pick your language. For PHP, Python and JavaScript we wrote one small function, cima(), which posts one action and raises an exception when the reply contains error; every later snippet reuses it.
POSThttps://smmcima.com/api/v2
Snippets pull the key from an environment variable, SMMCIMA_API_KEY; YOUR_API_KEY is a stand-in. Service 8123, order IDs and links are fictional. Live add calls cost live money, so keep test quantities tiny.
cURL: your balance in one call
The helper function
PHP (streams, no curl needed)
<?php
function cima(string $action, array $params = []): array
{
$payload = http_build_query(['key' => getenv('SMMCIMA_API_KEY') ?: 'YOUR_API_KEY', 'action' => $action] + $params);
$ctx = stream_context_create(['http' => [
'method' => 'POST',
'header' => 'Content-Type: application/x-www-form-urlencoded',
'content' => $payload,
'timeout' => 30,
'ignore_errors' => true, // also read the JSON body of a 429
]]);
$raw = file_get_contents('https://smmcima.com/api/v2', false, $ctx);
$reply = json_decode((string) $raw, true);
if (! is_array($reply)) {
throw new RuntimeException('Not a JSON reply');
}
if (isset($reply['error'])) { // errors come with HTTP 200
throw new RuntimeException($reply['error']);
}
return $reply;
}
Python (requests)
import os
import requests
ENDPOINT = "https://smmcima.com/api/v2"
KEY = os.getenv("SMMCIMA_API_KEY", "YOUR_API_KEY")
def cima(action, **params):
reply = requests.post(ENDPOINT, data={"key": KEY, "action": action, **params}, timeout=30).json()
if isinstance(reply, dict) and "error" in reply: # HTTP 200 even on errors
raise RuntimeError(reply["error"])
return reply
Node.js 18 or later (built-in fetch)
const ENDPOINT = "https://smmcima.com/api/v2";
export async function cima(action, params = {}) {
const form = new URLSearchParams({ key: process.env.SMMCIMA_API_KEY ?? "YOUR_API_KEY", action, ...params });
const response = await fetch(ENDPOINT, { method: "POST", body: form });
if (response.status === 429) throw new Error("Per-minute limit reached: wait and retry");
const reply = await response.json();
if (reply && !Array.isArray(reply) && reply.error) throw new Error(reply.error);
return reply;
}
Find Instagram services
services returns the whole catalog at your price per 1,000. Narrow it down on your side by category or name, but always send the number to add, because names can change.
ig = [s for s in cima("services") if "instagram" in (s["category"] or "").lower()]
for s in ig:
# ID | rate per 1,000 | quantity range | label
print(f'{s["service"]} | {s["rate"]} | {s["min"]}..{s["max"]} | {s["name"]}')
Place an order
Call add once and save the order number it returns right away. Lost the connection mid-call? Check your account's order list before anything else, since a second add means a second paid order.
$created = cima('add', [
'service' => 8123, // made-up ID
'link' => 'https://www.tiktok.com/@yourbrand/video/7300000000000000000',
'quantity' => 200,
]);
echo 'New order ID: ', $created['order'], PHP_EOL;
Poll orders until they finish
One status call takes 100 numbers. Poll roughly every three minutes and remove an order from the list once it reaches a final status. For Canceled, look at charge: a non-zero charge means the refund is still pending, so keep that ID in the loop.
import { cima } from "./cima.js";
const watching = new Set([20417, 20418]); // made-up IDs
const settled = (row) =>
row.status === "Completed" || row.status === "Partial" || row.status === "Refunded" ||
(row.status === "Canceled" && Number(row.charge) === 0);
while (watching.size > 0) {
const batch = [...watching].slice(0, 100).join(",");
const reply = await cima("status", { orders: batch });
const rows = Array.isArray(reply) ? {} : reply; // guard against an empty reply
for (const [id, row] of Object.entries(rows)) {
if (!settled(row)) continue;
console.log(id, row.status, "undelivered:", row.remains);
watching.delete(Number(id));
}
await new Promise((done) => setTimeout(done, 3 * 60 * 1000)); // every 3 minutes
}
Cancel open orders
Every ID gets either 1 (halted, unused money credited) or an error. Resend only the numbers whose error asks for a retry; the others will not change.
curl -s https://smmcima.com/api/v2 \
-d key="$SMMCIMA_API_KEY" -d action=cancel -d orders=20417,20418
# [{"order":20417,"cancel":1},{"order":20418,"cancel":{"error":"Cancel is not available for this order"}}]
Before you plug in your shop
- Run a small paid test on each service you intend to offer.
- Log every JSON response: an error also arrives with HTTP 200.
- Keep each key under 300 requests per minute and back off when you see a 429.
- Read the refund rules so what you return to your customers matches what comes back to your balance. Every field is explained in the action reference, and the big picture sits in the API overview.
Facts last checked: