API documentation

Everything you need to submit URLs from your own code. Keys are created on the dashboard and inherit your account's credits and limits.

Authentication

Every request carries your API key. Send it in the x-api-key header (preferred) or as a Bearer token.

curl banglakagaj.in/v1/balance \
  -H "x-api-key: ib_your_key_here"

Keys are shown once when created and stored hashed. Revoke one any time from the dashboard; requests with it fail immediately with 401.

Submit URLs

POST /v1/submit queues a batch. Credits are charged on acceptance and the batch is handed to the indexer within seconds.

FieldTypeNotes
urlsstring[] or newline string Required. Up to 20,000. Invalid lines are skipped and reported; duplicates removed.
engine"google" | "bing"Required.
mode"standard" | "instant" Google only; default standard.
namestringOptional label, up to 80 chars.
curl -X POST banglakagaj.in/v1/submit \
  -H "x-api-key: ib_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "engine": "google",
    "mode": "standard",
    "name": "Blog - September",
    "urls": ["https://example.com/post-1", "https://example.com/post-2"]
  }'
{
  "status": "ok",
  "submissionId": "7c1e…",
  "creditsUsed": 2,
  "balance": 498,
  "urlCount": 2,
  "skipped": { "invalid": [], "invalidCount": 0, "duplicates": 0 },
  "estimatedCompletion": "Google 24-hour batches are processed within about 24 hours."
}

The response is 201 on success. Only http:// and https:// URLs are accepted; a line without a scheme gets https:// prepended. Anything else is rejected and never charged.

Check status

Poll GET /v1/submissions/:id no more than once a minute. Status moves queued → processing → completed. Failed batches are refunded automatically.

List your batches with GET /v1/submissions?page=1&pageSize=25 (max pageSize 200).

Balance & costs

GET /v1/balance
{ "status": "ok", "balance": 498,
  "creditCosts": { "google_standard": 1, "google_instant": 10, "bing": 10 } }

Errors

HTTPcodeMeaning
400bad_requestValidation failed; details.invalid explains what.
401unauthorizedMissing, invalid or revoked key.
402insufficient_creditsdetails.needed/balance. Nothing charged.
403forbiddenAccount suspended.
404not_foundUnknown submission id (or one that isn't yours).
415unsupported_media_typeBody must be JSON.
429rate_limitedSlow down; honour Retry-After.

Rate limits

Limits are per API key and per minute. Every response carries the current window:

HeaderNotes
X-RateLimit-LimitRequests allowed per minute for this key.
X-RateLimit-RemainingRequests left in the current window.
X-RateLimit-ResetUnix time when the window resets.
Retry-AfterHeader on 429 only: seconds to wait.

Retries & idempotency

Network hiccups and CMS retries can resend a submit. Add an Idempotency-Key header and repeats return the original result instead of charging twice. Keys are remembered for 24 hours per account; replays answer with HTTP 200 and Idempotent-Replayed: true.

curl -X POST banglakagaj.in/v1/submit \
  -H "x-api-key: ib_your_key_here" \
  -H "Idempotency-Key: post-1842-publish" \
  -H "Content-Type: application/json" \
  -d '{"engine":"google","urls":["https://example.com/post-1842"]}'

Node / Bun / Deno

const res = await fetch("banglakagaj.in/v1/submit", {
  method: "POST",
  headers: { "x-api-key": process.env.INDEX_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({ engine: "google", mode: "instant", urls }),
});
const data = await res.json();
if (!res.ok) throw new Error(data.error);