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

> ## Agent Instructions
> CrispStats is a hosted, privacy-first web analytics product. It has no self-hosted edition, no session replay, no heatmaps, no A/B testing, no mobile SDKs and no data import except a site's history from a Plausible export (Settings, Import and export).
> The script global is crispstats(...), site keys start with cs_pk_ and secret API keys start with cs_sk_. The script is served from https://in.crispstats.com/d.js and the REST API lives at https://crispstats.com/api/v1.
> There is no npm package to install. Integrations copy the script tag, the queue stub, crispstats.d.ts and proxy code from these docs or from Settings, Tracking code in the dashboard. A first-party proxy forwards one path of the site to https://in.crispstats.com/p/ and forwards only content-type, user-agent, accept-language, referer, origin, if-none-match and x-forwarded-for, never cookies.

# Domain Rating widgets

> Show your site's Domain Rating from Ahrefs on your site or README as a gauge card, a pill or a badge, with the attribution Ahrefs requires.

Domain Rating is [Ahrefs](https://ahrefs.com/)' score from 0 to 100 for the strength of a domain's backlink profile: the higher it is, the more strong sites link to it. CrispStats reads your site's own Domain Rating from Ahrefs, keeps a daily history, and shows it in the widgets you create.

![A card headed Domain Rating for quillbook.com with a gauge at 43 of 100, up 3 in 30 days, a 90-day line, Read today, Domain Rating by Ahrefs and Powered by CrispStats](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/dr-card-light.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=81063ad87aac72d4f050da0624107975)

Domain Rating card

![A pill with a small gauge reading DR 43, Domain Rating by Ahrefs, and the CrispStats mark](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/dr-pill-light.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=0588eef48c0fe32b6bff11bcf6fcefeb)

Domain Rating pill, outline style

## Where it shows

* **Widgets**: a card with a gauge, a one-line pill, or a badge for a README.
* **[Site summary](https://docs.crispstats.com/share/widgets/site-summary.md)**: a card with your visitors in the last 30 days and the rating side by side, with a donut, over a 30-day line.

The public demo shows a generated rating for its sample site.

## How often it is read

| Your site | Read |
| - | - |
| Has an enabled Domain Rating or site summary widget | Once a day |
| Had visits in the last 30 days | Once every 7 days |
| Neither | Not read |

The first reading does not wait for the schedule. When you create a Domain Rating or site summary widget for a site that has never been read, CrispStats asks Ahrefs straight away, usually within a few seconds; it tries at most once an hour per site.

Each reading is the rating Ahrefs reports that day. The change compares with the reading about 30 days earlier, so it appears once a month of history exists. The 90-day line needs at least 14 daily readings, which only daily reads build up: create a widget if you want the line.

## Why it can be missing

| What you see | Why |
| - | - |
| No Domain Rating anywhere for a site | The site's domain cannot have a rating: `localhost`, an IP address, a name without a dot, or a reserved name such as `.test`, `.local` or `example.com`. The widget gallery marks the Domain Rating tiles **Needs a public domain**. Set the site's real domain in **Settings**, **General**. |
| "Not read yet" | The site has not been read. Create a Domain Rating or site summary widget to read it now. |
| `DR 0` | A real reading: Ahrefs knows the domain but sees no strong links to it yet. New domains often start at 0. |
| A widget that does not show | No reading exists yet, or Ahrefs had none for the domain. The widget stays hidden, with no gap or broken image, until a reading arrives. |
| An older date, such as `Read 21 Nov` | Today's read failed, for example because Ahrefs did not answer. The last reading shows with its date |

The rated domain is your site's domain without `www.` and without a port. A subdomain is rated as itself: a site on `app.quillbook.co.uk` shows the rating of `app.quillbook.co.uk`. If you change the site's domain, the rating starts again for the new one.

## Only your own domain

CrispStats reads the Domain Rating of the domains of sites that exist in CrispStats, each at most once a day, and nothing else. There is no screen, API endpoint, MCP tool or parameter that looks up any other domain. The request to Ahrefs carries the domain and nothing more: no site id and no visitor data. The reading and its history are stored with the site and deleted with it.

Domain Rating is public information about a public domain, so a Domain Rating widget needs no consent step. **What becomes public** still lists it: your Domain Rating from Ahrefs and the day it was read, its change over 30 days and the 90-day line when they are on, and your site's domain.

## Attribution

Ahrefs' licence asks that "Domain Rating by Ahrefs" appear next to the number wherever it is shown, with "Ahrefs" linking to `https://ahrefs.com/`. CrispStats does this everywhere, on every plan, in addition to our own credit:

| Where | How |
| - | - |
| Dashboard, script and iframe | The line `Domain Rating by Ahrefs` next to the number, with `Ahrefs` as a link. It is a separate link from our credit, never inside it. Page styles cannot hide it. |
| Image (SVG) | The image itself reads `Domain Rating by Ahrefs`, and the code wraps it in a link to Ahrefs. Our credit, when shown, is a second text link after the image. |
| shields.io | The badge's label is always `Domain Rating by Ahrefs`, and the Markdown links it to Ahrefs. |
| JSON | The payload's `source` field holds the text, the linked words and the link. Show them next to the number. See [Widget JSON](https://docs.crispstats.com/share/widgets/json-api.md#the-source-field). |

Switching off **Credit** on a paid plan removes our credit only. The Ahrefs line stays, and a Domain Rating widget has no **Label** for the pill or the badge, so the wording cannot change. The card's heading can take a label. There is no Ahrefs logo anywhere, and nothing suggests Ahrefs endorses your site or CrispStats.

## The widget

| Layout | What it shows |
| - | - |
| Card | **Domain Rating** and the domain, a gauge with the figure and `of 100`, the change (`↑ 3 in 30 days` or `No change in 30 days`), the 90-day line, the read date (`Read today`, `Read yesterday`, `Read 21 Nov`), then `Domain Rating by Ahrefs` and our credit. The line is scaled to the readings, at least 10 points tall, so a change of a few points shows; the gauge shows where the rating sits between 0 and 100. Without enough history the change or the line is left out. |
| Pill | A small gauge, `DR 43`, `Domain Rating by Ahrefs` and our mark. At size Small the gauge is dropped; the attribution is never shortened. |
| Badge | An image with `Domain Rating by Ahrefs` on the left and the figure on the right. |

![A flat badge reading Domain Rating by Ahrefs, 43](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/badge-dr-flat-light.svg?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=dadd7b9acd6704acdbdb4cd86b16ca22)

Badge, flat

![A rounded badge with a dot reading Domain Rating by Ahrefs, 43](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/badge-dr-crisp-light.svg?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=5fd4cbf8d63c0be819f40be8815015f6)

Badge, crisp

**Change over 30 days** and **90-day line** switch those parts of the card on or off. The rating changes once a day at most, so the script refreshes it every 10 minutes while the tab is visible and the collector caches it for 5 minutes.

## Add the widget

1. Open **Settings**, **Sharing and widgets** and pick **Domain Rating card**, **Domain Rating pill** or, for a README, **Domain Rating badge**. A note above the controls repeats that the Ahrefs line always shows.
2. Select **Create widget**. If the site has no reading yet, this is when it is read.
3. Copy the code. On a page, the script draws the card with both links:

```html wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
<script async src="https://in.crispstats.com/w/v1/loader.js"></script>
<crispstats-widget widget="cs_wd_7Hq2Lx9PzK4mVt8RbN3cW1yD" style="display:inline-block;vertical-align:middle;width:320px;height:176px"></crispstats-widget>
```

In a README, the image links to Ahrefs and our credit follows as its own link:

```html wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
<a href="https://ahrefs.com/"><picture><source media="(prefers-color-scheme: dark)"><img alt="Domain Rating of quillbook.com, by Ahrefs" src="https://in.crispstats.com/w/v1/i/cs_wd_7Hq2Lx9PzK4mVt8RbN3cW1yD.svg?theme=light" width="320" height="176"></picture></a>
<a href="https://crispstats.com/share/quillbook">Powered by CrispStats</a>
```

Where only Markdown is allowed, the **Markdown** tab gives the same two links:

```md wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
[![Domain Rating of quillbook.com, by Ahrefs](https://in.crispstats.com/w/v1/i/cs_wd_7Hq2Lx9PzK4mVt8RbN3cW1yD.svg)](https://ahrefs.com/) [Powered by CrispStats](https://crispstats.com/share/quillbook)
```

As a shields.io badge:

```md wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
[![Domain Rating by Ahrefs](https://img.shields.io/endpoint?url=https%3A%2F%2Fin.crispstats.com%2Fw%2Fv1%2Fs%2Fcs_wd_7Hq2Lx9PzK4mVt8RbN3cW1yD)](https://ahrefs.com/) [Powered by CrispStats](https://crispstats.com/share/quillbook)
```

On a paid plan with the credit switched off, the README form keeps only the Ahrefs link:

```html wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
<a href="https://ahrefs.com/"><picture><source media="(prefers-color-scheme: dark)"><img alt="Domain Rating of quillbook.com, by Ahrefs" src="https://in.crispstats.com/w/v1/i/cs_wd_7Hq2Lx9PzK4mVt8RbN3cW1yD.svg?theme=light" width="320" height="176"></picture></a>
```

Your own code carries your widget's token instead of `cs_wd_7Hq2Lx9PzK4mVt8RbN3cW1yD`. Other forms are on [Embed a widget](https://docs.crispstats.com/share/widgets/embed.md).

## Next steps

> [card] [Widgets](https://docs.crispstats.com/share/widgets.md)
>
> Every kind of widget, the styles and the limits.

> [card] [Embed a widget](https://docs.crispstats.com/share/widgets/embed.md)
>
> Script, iframe, README, Notion, shields.io and React.

> [card] [Data collected](https://docs.crispstats.com/privacy/data-collected.md)
>
> Everything CrispStats stores, and for how long.


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