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

# Find your site ID

> Every report needs a site_id. Look it up once by domain or name.

Every report takes a `site_id`. List the sites your key can see and pick one by domain.

## How this example works

1. **One call lists every site** in the organization. No pagination.
2. **Match on `domain`**, which is unique and stable. Names can be edited in the dashboard.
3. **Save the ID** as `RANKRAFT_SITE_ID`; it never changes.

```js JavaScript theme={"system"}
import { RankRaft } from "rankraft-js";

const rr = new RankRaft(); // reads RANKRAFT_API_KEY

const sites = await rr.sites.list();
for (const s of sites) console.log(s.id, s.domain, s.name, s.platforms.join(","));

// Or find one by domain.
const site = sites.find((s) => s.domain === "misalifoods.com");
if (site) console.log(`\nexport RANKRAFT_SITE_ID=${site.id}`);
```

```python Python theme={"system"}
from rankraft import RankRaft

with RankRaft() as rr:  # reads RANKRAFT_API_KEY
    sites = rr.sites.list()
    for s in sites:
        print(s["id"], s["domain"], s["name"], ",".join(s["platforms"]))

    # Or find one by domain.
    site = next((s for s in sites if s["domain"] == "misalifoods.com"), None)
    if site:
        print(f"\nexport RANKRAFT_SITE_ID={site['id']}")
```

```bash curl theme={"system"}
curl https://api.rankraft.ai/v1/sites \
  -H "X-API-Key: $RANKRAFT_API_KEY"
```

## What comes back

| Field | Contents |
| - | - |
| `id` | The `site_id` every report takes. |
| `domain` | The site's main domain. |
| `name` | The display name from the dashboard. |
| `platforms` | Engines the site is scanned on, already limited to what your plan includes. |
| `last_answer_scan` | `{ date, status }` of the latest daily scan, or `null` before the first. A site with `null` has no answer data yet. |
| `created_at` | When the site was added. |

> [!TIP]
>
> Reports for a site that has not finished setup in the dashboard return `409 site_not_set_up`. Finish onboarding first.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.