# Get Analytics Data Source Result

Read a data source's stored rows and how its last fetch went. Poll it after Create, Update or Fetch Analytics Data Source until status is ready (or failed, with message saying why). Page through the rows with limit and offset; nextOffset is the offset of the next window, null on the last. While a first fetch is still running, the rows stored so far come back with isPartial true: their shape is final, so you can design panels on them. A live source stores no rows. For a source another member owns, send the id of a page shared with the creator that uses it.

`GET https://connect.mindcloud.co/v2/analytics/data-sources/:dataSourceId/result`

Permissions: `analytics:page:view`.

## Parameters

### Path

- `dataSourceId` (string, required): The data source's id, from List Analytics Data Sources or a panel's dataSources.

### Headers

- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. Here a key acts in another organization only as one of its members: with "Use this key across all of your organizations" on, in an organization its creator belongs to with a role. Child organizations and MindCloud staff access do not reach this endpoint. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

### Query

- `pageId` (string): For a source another member owns: a page shared with the key's creator that uses it, from List Analytics Pages.
  For a source another member owns: the id of a page shared with the key's creator that uses it, from List Analytics Pages.
- `limit` (number): How many rows to answer, 1-1000.
  How many rows to answer, 1-1000. Defaults to 100.
  Default: `100`
- `offset` (number): How many rows to skip.
  How many rows to skip. Defaults to 0.
  Default: `0`

## Example request

```bash
curl --request GET \
  --url 'https://connect.mindcloud.co/v2/analytics/data-sources/Ds3Hq9Lp2WxM/result?pageId=Pq7Lm2Xc9RtA&limit=100&offset=0' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN'
```

## Response fields

- `id` (string): The data source's id.
- `status` (string): Where its data stands. live: a live source, which has no stored data; neverFetched: no fetch has run yet; noData: a fixed source with no rows yet; draft: waiting for its first fetch; queued: a fetch is waiting to start; refreshing: a fetch is running; ready: its rows are stored; empty: the last fetch returned no rows; failed: the last fetch failed (see message).
  Allowed values:
    - `live`
    - `neverFetched`
    - `noData`
    - `draft`
    - `queued`
    - `refreshing`
    - `ready`
    - `empty`
    - `failed`
- `fetchedOn` (date): When the stored rows were fetched.
- `message` (string): Why the last fetch failed, when it did.
- `isTruncated` (boolean): True when the fetch stopped at a size limit, so the stored rows are not the whole set.
- `isPartial` (boolean): True while a first fetch is still running: these are the rows stored so far, and their shape is final.
- `columns` (array of string): The column names the rows carry, in order.
- `rows` (array of objects): The rows in this window, as objects keyed by column.
- `rowCount` (number): How many rows there are in all.
- `offset` (number): Where this window starts.
- `nextOffset` (number): The offset of the next window, or null when this is the last.
