Nest API · Reference
API reference
Complete endpoint reference for the Nest API (Magpie Scraping Service API v1.0.0). Submit scraping jobs, poll status, and download results across Shopee variant-sold, PDP, search, and merchant endpoints.
Getting started
Base URL & authentication
All requests go to the base URL below over HTTPS. Authenticate with a Bearer token (your API key) in the Authorization header. Request access from the Nest API page.
Endpoints
All endpoints
/shopee/variant_sold_v1/submitSubmit a new scraping job
Accepts up to **50,000 items**, one country per request, and chunks each group into batches of 50 (for background processing). This endpoint only gets processed during working hours (8am-6pm GMT+8) **Cost: 10 credits per item_id.** Balance is checked upfront — returns `402` if insufficient.
Starts in `awaiting_approval` with **no credits deducted yet**. The team is notified and waits for approval (24h timeout). **Credits are only deducted when approved.** On rejection or timeout, the job ends in `rejected` with no charge.
Returns `202 Accepted` with a `job_id` for polling via `GET /retrieve/{job_id}`.
Request body · SubmitRequest
Responses
202— Job accepted; awaiting approval or already queued. · SubmitResponse401— Missing or invalid Bearer token. · ErrorResponse402— Insufficient quota balance. Response includes `required`, `current`, and `shortfall`. · QuotaErrorResponse422— Payload validation failed (bad country code or schema).
/shopee/variant_sold_v1/retrieve/{job_id}Retrieve job status and download URLs
Returns the consolidated status of a submitted job, along with per-batch details and **time-limited signed URLs** for any `SUCCESS` batches. This endpoint only gets processed during working hours (8am-6pm GMT+8)
Parameters
Responses
200— Job found; returns status and per-batch details. · JobRetrieveResponse401— Missing or invalid Bearer token. · ErrorResponse404— Job not found, or not owned by the authenticated user. · ErrorResponse422— Validation Error · HTTPValidationError
/shopee/variant_sold_v1/download/{job_id}Download the merged result for a job
Returns counters and a **signed URL** to the merged `full_{job_id}.json` containing every item in the job. This endpoint only gets processed during working hours (8am-6pm GMT+8)
If the job has not yet been completed, `download_url` will be `null` and the counts will reflect current progress.
Parameters
Responses
200— Job found; signed URL included when available. · JobDownloadResponse401— Missing or invalid Bearer token. · ErrorResponse404— Job not found or not owned by caller. · ErrorResponse422— Validation Error · HTTPValidationError
/shopee/variant_sold_v1/download/{job_id}/item/{item_id}Download a single item result
Returns the scraped payload for a single item directly from the database. This endpoint only gets processed during working hours (8am-6pm GMT+8)
`data` is populated only when `status == SUCCESS`. For `FAILED` items, `error_log` explains the reason.
Parameters
Responses
200— Item found. · ItemDownloadResponse401— Missing or invalid Bearer token. · ErrorResponse404— Job or item not found, or not owned by caller. · ErrorResponse422— Validation Error · HTTPValidationError
/shopee/get_pc/submitSubmit a PDP tier 2 task
Creates one asynchronous Shopee PDP tier 2 task (get_pc). Cost: 8 credits per request.
Request body · ShopeeGetPcSubmitRequest
Responses
202— Task accepted. · ShopeeGetPcSubmitResponse401— Missing or invalid Bearer token. · ErrorResponse402— Insufficient quota balance. · QuotaErrorResponse422— Payload validation failed.502— Failed to create task. · ErrorResponse
/shopee/get_pc/retrieve/{task_id}Retrieve a PDP tier 2 task
Polls one owned PDP tier 2 Hoarder task and returns the GCS JSON result when ready.
Parameters
Responses
200— Task status or result. · ShopeeGetPcRetrieveResponse401— Missing or invalid Bearer token. · ErrorResponse404— Task not found. · ErrorResponse502— Failed to retrieve task or result. · ErrorResponse422— Validation Error · HTTPValidationError
/shopee/search-items/submitSubmit Shopee search/category scraping tasks
Submits multiple URLs to scrape items from Shopee search or category pages. This endpoint only gets processed during working hours (8am-6pm GMT+8) **Cost: 6 credits per URL.** Balance is checked upfront. Up to 50 urls per request.
The job goes through the approval by our team before processing. Poll `GET /retrieve/{job_id}` to check progress.
Request body · SearchItemsSubmitRequest
Responses
202— Job accepted; awaiting approval. · PgntSubmitResponse401— Missing or invalid Bearer token. · ErrorResponse402— Insufficient quota balance. · QuotaErrorResponse422— Payload validation failed.
/shopee/search-items/retrieve/{job_id}Retrieve search/category job status
Returns the current status and per-URL results when complete. This endpoint only gets processed during working hours (8am-6pm GMT+8)
Parameters
Responses
200— Job status. · PgntRetrieveResponse401— Missing or invalid Bearer token. · ErrorResponse404— Job not found. · ErrorResponse422— Validation Error · HTTPValidationError
/shopee/merchant-items/submitSubmit Shopee merchant/shop scraping tasks
Submits multiple URLs to scrape all items from Shopee merchant/shop pages. This endpoint only gets processed during working hours (8am-6pm GMT+8) **Cost: 6 credits per URL.** Balance is checked upfront. Up to 50 urls per request.
The job goes through the approval by our team before processing. Poll `GET /retrieve/{job_id}` to check progress.
Request body · MerchantItemsSubmitRequest
Responses
202— Job accepted; awaiting approval. · PgntSubmitResponse401— Missing or invalid Bearer token. · ErrorResponse402— Insufficient quota balance. · QuotaErrorResponse422— Payload validation failed.
/shopee/merchant-items/retrieve/{job_id}Retrieve merchant job status
Returns the current status and per-URL results when complete. This endpoint only gets processed during working hours (8am-6pm GMT+8)
Parameters
Responses
200— Job status. · PgntRetrieveResponse401— Missing or invalid Bearer token. · ErrorResponse404— Job not found. · ErrorResponse422— Validation Error · HTTPValidationError
/shopee/pgnt/jobs/{job_id}/items/{item_token}/dataDownload PGNT result JSON for a specific URL
Returns the JSON payload collected for the given URL once it is marked SUCCESS. This endpoint only gets processed during working hours (8am-6pm GMT+8)
Parameters
Responses
200— Result JSON.400— Invalid item token. · ErrorResponse401— Missing or invalid Bearer token. · ErrorResponse404— Result not available. · ErrorResponse502— Failed to fetch result data. · ErrorResponse422— Validation Error · HTTPValidationError
/healthHealth check
Simple liveness probe. Returns `{"status": "ok"}` if the service is running.
Responses
200— Successful Response
Reference