Skip to content

Build an API from a website

An agent-data build turns a source website into a catalog API. This guide uses the StockX build and its categories operation.

The captured build request, status responses, and CLI data call come from November 14, 2026. StockX has a published API. A repeat submission may match it instead of creating a build.

Use your own missing source when you intend to create an API. You can use StockX for the final data call.

You need an authenticated CLI, an HTTP API key, or a connected MCP client. See CLI setup if you need to install it. Usage explains build and call allowances.

The captured build and data result use the CLI. The HTTP and MCP variants describe the corresponding interfaces, without separate captured submissions or data calls.

  1. Submit the source website.
  2. Follow the build to publication.
  3. Call a published operation.

1. Submit a source and recognize acceptance

Section titled “1. Submit a source and recognize acceptance”

The StockX request supplies https://stockx.com/. Omit --task when the website URL is sufficient. Add a task when you need to describe particular records or inputs.

Terminal window
agent-data parse https://stockx.com/

For your source, add --dry-run to preview the request. Remove it when you intend to submit the build.

The CLI returned these selected fields at 14:15 UTC.

{
"matched": false,
"parse_job_id": "pj_1da416ddc9adccdf2a0856d7",
"status": "queued",
"phase": "building",
"status_url": "/api/v1/parse/pj_1da416ddc9adccdf2a0856d7",
"serving_changed": false
}

parse_job_id identifies the accepted build. Save it for status reads. matched: false means the request started new work.

serving_changed: false means acceptance did not change the serving API. If your response has matched: true, read the returned API contract instead. See source matching.

Use the returned build ID with the submitting account. Substitute your own ID for account-specific reads.

Terminal window
agent-data parse status pj_1da416ddc9adccdf2a0856d7
agent-data parse events pj_1da416ddc9adccdf2a0856d7 --follow

The StockX status reads contain these states.

Capture time, November 14, 2026StateAvailable result
14:16 UTCbuilding, presentation startingA saved request without a listing or API URL.
14:38 UTCbuilding, presentation workingActive work without a usable API URL.
15:04 UTClive, presentation readyA published listing and call example.

The final status contains these selected fields.

{
"parse_job_id": "pj_1da416ddc9adccdf2a0856d7",
"phase": "live",
"listing_id": "42338ad3-fa01-4b3a-901f-a9aecf2a027a",
"last_verified_at": "2026-11-14T14:58:49.107Z",
"error": null
}

listing_id identifies the published StockX Public Product API. Its route slug categories names an operation inside that API.

The recorded verification time is 14:58 UTC. This example does not establish a duration for other builds. Use build recovery if your status reports a failure or required action.

List recent builds if you did not save the acceptance response.

Terminal window
agent-data parse list --limit 20 --offset 0

Match the website URL and creation time. Copy the returned parse_job_id, which identifies your build.

HTTP provides GET /api/v1/parse?limit=20&offset=0 at https://agent-data.motie.dev. Use your bearer credential. MCP has no build-list tool.

A closed terminal or disconnected event stream does not cancel the build. Read status after you reconnect.

Read presentation.summary, phase, error, and the available actions together. CLI --follow streams recorded events. See event options for saved cursors and starting sequences.

MCP has no event-stream tool. Repeat parse_status to read progress.

3. Inspect and call the published operation

Section titled “3. Inspect and call the published operation”

Use the API’s handle to read its contract. The StockX catalog entry uses stockx-com.

  1. Read the contract.
  2. Call categories.
Terminal window
agent-data docs stockx-com
agent-data call stockx-com categories

The contract defines categories as GET /v1/categories with no inputs. The CLI call returned eight categories at 16:18 UTC. This excerpt contains the first record.

{
"categories": [
{
"name": "Sneakers",
"slug": "sneakers",
"type": "CONFIGURED",
"textColor": "",
"url": "https://stockx.com/category/sneakers",
"urlType": "BROWSE"
}
],
"returned_count": 8,
"source_url": "https://stockx.com/"
}

returned_count: 8 describes the complete result. The remaining names are Shoes, Apparel, Accessories, Collectibles, Trading Cards, Mystery Boxes, and More. Names and availability can change.

sneakers is a category value. categories is the route slug. The contract accepts the category’s slug as the products operation’s category input.

The request produced a published API with category and product operations. The captured call establishes a successful categories request.

See example coverage for capture dates and operations without recorded executions.

Status reads do not change the work. Resume and cancellation requests do.

Read agent-data parse status <job-id> for a build. Read agent-data parse extension status <request-id> for an extension.

<job-id> is your returned pj_… build identifier. <request-id> is the UUID saved with your extension request. List recent builds if you lost a build ID.

Check phase, presentation.summary, available actions, and error. A transport timeout means the client lacks a complete response. It does not establish server rejection.

For an extension timeout, use the saved-request retry procedure.

What you seeWhat to do
Work remains active without a requested action.Follow the existing build.
contract_changedRead the target again. Prepare a new request against its contract.
A source or build conflict.Find the existing API or build. Read its contract or status.
A blocked build offers continuation.Resume that build.
Publication or verification fails.Follow the reported next action, or contact support with the error and identifiers.
Unfinished work you intend to stop.Request cancellation.

Use resume only when status offers continuation. A blocked or failed state alone does not establish that the action is available.

agent-data parse resume <job-id>
agent-data parse status <job-id>

Substitute your blocked build ID for <job-id>. CLI 0.13.0 resume accepts no prompt or task argument.

agent-data parse cancel <job-id> --reason "No longer needed"
agent-data parse status <job-id>

Substitute your build ID for <job-id>. Omit --reason if you need no recorded reason.

Cancellation does not undo completed publication or other effects. Check the final state instead of treating action acceptance as a stopped build.

ActionSuccess check
ResumeNew progress followed by publication.
CancelA final cancelled or stopped outcome.
Complete an extensionSaved-request published plus a successful call to the changed operation.

For a completed build, use its catalog handle to read the contract. Call the intended operation with current inputs. The published-operation step shows this final check.

What you seeWhat to do
request.prompt: unknown fieldFollow the CLI error fix.
extension_request_not_foundCheck the submitting account and exact saved UUID.
Existing execution requires its original Git branch and repositoryContact support with the build ID because public resume cannot correct the recorded execution identity.

The last error occurred after an accepted resume request. Acceptance alone does not establish renewed progress.

Use the support checklist if the reported action does not resolve the failure.

Use Extend an API when the website already has an API but lacks an operation you need.