---
title: "Run an actor (auto or manual proxy mode; async, or wait for the result directly)"
method: POST
path: "/v1/actors/{slug}/runs"
tags: ["actors"]
---

# Run an actor (auto or manual proxy mode; async, or wait for the result directly)

`POST /v1/actors/{slug}/runs`

## Request

- Base URL: `https://barchin.net/api`
- URL: `https://barchin.net/api/v1/actors/{slug}/runs`
- Auth: HTTP bearer

## Path parameters

- `slug` string, required

## Query parameters

- `wait` integer: 0 = async, returns run_id. >0 = wait up to this many seconds for the result. ۰ = async و برگرداندن run_id؛ >۰ = تا این ثانیه منتظر نتیجه بمان (سقف سرور: SYNC_MAX_WAIT_SECONDS). اگر در این مدت تمام نشد، ۲۰۲ با run_id برمی‌گردد و اجرا **ادامه دارد**؛ آن را با status_url دنبال کنید.
- `mode` 'auto' | 'manual'
- `proxy` 'datacenter' | 'residential' | 'unblocker': The public name of a tier; this is what the API accepts and returns.
- `country` string, nullable: Two-letter country code the exit IP should be from (e.g. ir). Default: worldwide. کد دو حرفی کشوری که IP خروجی باید از آن باشد (مثل ir). پیش‌فرض: جهانی. سایت‌هایی که فقط به کاربران کشور خودشان سرویس می‌دهند IP خارجی را رد می‌کنند. روی پروکسی دیتاسنتر اثری ندارد.

## Request body

- ActorRunCreateIn: Free-form actor input; the actor's runner validates it (extra keys allowed).
  - `url` string, nullable

## Response `200`

نتیجه‌ی آماده (حالت wait)

- ActorRunDetailOut
  - `run_id` string, uuid, required
  - `actor_slug` string, required
  - `actor_title` string, nullable
  - `country` string, nullable
  - `status` 'queued' | 'processing' | 'succeeded' | 'failed', required
  - `input` object, required
  - `mode` 'auto' | 'manual', required
  - `proxy_requested` 'datacenter' | 'residential' | 'unblocker', required: The public name of a tier; this is what the API accepts and returns.
  - `proxy_used` 'datacenter' | 'residential' | 'unblocker', required: The public name of a tier; this is what the API accepts and returns.
  - `base_credits` integer, required
  - `page_budget` integer, required
  - `pages_fetched` integer, nullable, required
  - `credits_per_page` integer, nullable, required
  - `credits_held` integer, required
  - `credits_charged` integer, nullable, required
  - `credits_released` integer, required
  - `item_count` integer, required
  - `source` 'api' | 'dashboard', required
  - `created_at` string, date-time, required
  - `started_at` string, date-time, nullable, required
  - `finished_at` string, date-time, nullable, required
  - `queued_ms` integer, nullable
  - `duration_ms` integer, nullable
  - `total_ms` integer, nullable
  - `queue_position` integer, nullable
  - `eta_ms` integer, nullable
  - `error` ActorRunErrorOut
    - `code` string, required
    - `message` string, required
  - `warning` ActorRunWarningOut: Advisory only — the run was accepted and executes exactly as asked.
    - `code` string, required
    - `message` string, required
  - `refund` ActorRunRefundOut
    - `credits` integer, required
    - `message` string, required
  - `meta` object, nullable
  - `dataset` object[], nullable

## Other responses

- `202`: در صف (async، یا wait که به نتیجه نرسید)
- `400`: ترکیب نامعتبر mode و proxy
- `401`: Unauthorized
- `402`: Payment Required
- `403`: Forbidden
- `404`: Not Found
- `422`: Unprocessable Entity
- `429`: Too Many Requests
- `503`: Service Unavailable

---

[API](https://skmtc.dev/barchin/apis/barchin-scraping-api.md) · [All operations](https://skmtc.dev/barchin/apis/barchin-scraping-api/llms.txt) · [OpenAPI document](https://skmtc.dev/barchin/apis/barchin-scraping-api/revisions/fe97e4690cc3?raw)
