> ## Documentation Index
> Fetch the complete documentation index at: https://www.octoparse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Hub API

> Discover, run, and bill Data Apps programmatically through the REST API, official client libraries, or MCP.

Every Data Hub capability is exposed through one public REST API. The web portal, MCP, and the Python and JavaScript client libraries are different ways to call the same data and the same billing rules.

## REST API

Base URL `https://api-datahub.octoparse.com`. Every endpoint starts with `/v1`. Requests and responses are JSON. Authenticated endpoints use `Authorization: Bearer <API Key>`. Create an API key in the Octoparse account center.

Start a run and wait for the result:

```bash theme={null}
curl -X POST \
  -H "Authorization: Bearer $OCTOPARSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product": "p-9001"}' \
  "https://api-datahub.octoparse.com/v1/data-apps/carol/reviews-query/runs?wait=60"
```

<CardGroup cols={2}>
  <Card title="API reference" href="/docs/en/datahub/api/reference/introduction">
    Shared conventions for auth, response shape, pagination, and errors, plus every endpoint by resource.
  </Card>

  <Card title="OpenAPI spec" href="/docs/en/datahub/api/openapi.yaml">
    Machine-readable contract you can import into Postman, codegen tools, or AI coding assistants.
  </Card>
</CardGroup>

## Client libraries

The official client libraries wrap every caller-facing REST endpoint. Methods map one-to-one to endpoints and return the raw `data` payload from the response.

<Tabs>
  <Tab title="Python">
    ```bash theme={null}
    pip install octoparse-client
    ```

    ```python theme={null}
    from octoparse_client import Client

    with Client(api_key="<your API key>") as client:
        result = client.search("reviews", limit=5)
        run = client.call("carol/reviews-query", {"product": "p-9001"})
        for record in client.iterate_records(run["run_id"]):
            print(record)
    ```

    <a href="/docs/en/datahub/api/clients/python">Python client library docs</a>
  </Tab>

  <Tab title="JavaScript">
    ```bash theme={null}
    npm install octoparse-client
    ```

    ```js theme={null}
    import { Client } from "octoparse-client";

    const client = new Client({ apiKey: "<your API key>" });
    const result = await client.search("reviews", { limit: 5 });
    const run = await client.call("carol/reviews-query", { product: "p-9001" });
    for await (const record of client.iterateRecords(run.run_id)) {
      console.log(record);
    }
    ```

    <a href="/docs/en/datahub/api/clients/javascript">JavaScript client library docs</a>
  </Tab>
</Tabs>

## MCP

To let an agent use Data Apps without writing code, connect the Data Hub general MCP. It exposes seven tools for search, detail, run, status, result, cancel, and list, and can pin a specific app as a dedicated tool. See <a href="/docs/en/datahub/mcp-capabilities">Data Hub MCP capabilities</a> and the <a href="/docs/en/datahub/quick-start/agent-connection/general">general connection guide</a>.

## For AI

* Full-site index: `https://www.octoparse.com/docs/llms.txt`
* Append `.md` to any docs URL to fetch the Markdown source.
* Contract-authoring skill: `GET /v1/skills/dataapp-contract-json.zip` for Claude Code, Codex, and similar assistants that generate Data App contracts.
