Skip to content
Back to skills

Ahrefs Dr

BSecurity

Get a site Domain Rating (DR) from the Ahrefs free public APIv3 endpoint. Use when the user asks for DR, domain rating, Ahrefs rating, or site authority for a domain or URL. ALWAYS load this skill for those tasks.

  • 44 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 7, 2026
toolsbashgitapi

Works with

  • api

Security analysis

B84/100
  • mediumUses curl or wget to download content
  • criticalExfiltrates credentials via HTTP — exact pattern from Snyk ToxicSkills study

Pro shows the line behind each finding and how to fix it

Scanned November 7, 2026

npx -y skills add remorses/opencode-config --skill ahrefs-dr --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ahrefs Dr?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ahrefs Dr
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/remorses-ahrefs-dr/badge)](https://www.skillsdirectory.com/skills/remorses-ahrefs-dr)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
$schema: https://gist.githubusercontent.com/remorses/9f3737a6f516c01f4bdb612045c64072/raw/agent-skill.schema.json
name: ahrefs-dr
description: >
  Get a site Domain Rating (DR) from the Ahrefs free public APIv3 endpoint.
  Use when the user asks for DR, domain rating, Ahrefs rating, or site
  authority for a domain or URL. ALWAYS load this skill for those tasks.
---

# Ahrefs Domain Rating

Fetch **Domain Rating** with the free public endpoint. **Free** means
Ahrefs does not charge API units. It does **not** mean open access.
A missing Bearer token returns `403 Forbidden`. Always send a free
APIv3 key.

Always fetch the current docs first. Never pipe through `head`, `tail`,
`sed -n`, `awk`, `| less`, or any command that truncates:

```bash
curl -sL https://docs.ahrefs.com/en/api/reference/public/get-domain-rating-free
```

Docs: https://docs.ahrefs.com/en/api/reference/public/get-domain-rating-free

## Auth

API key lives in `~/.config/opencode/skills/ahrefs-dr/.env` as
`AHREFS_API_KEY`. Load it. Never print the key. Never commit `.env`.
If the value is empty, stop and ask the user to paste a key from
https://app.ahrefs.com/account/api-keys

```bash
set -a
source ~/.config/opencode/skills/ahrefs-dr/.env
set +a
test -n "$AHREFS_API_KEY"
```

Free account is enough. Generate the key in Account settings → API keys.
Send it as `Authorization: Bearer <token>`.

## Get DR

`target` is required. Pass a domain or a URL. Use `--data-urlencode` so
query chars stay valid.

```bash
curl -sS --fail-with-body -G 'https://api.ahrefs.com/v3/public/domain-rating-free' \
  --data-urlencode 'target=playwriter.dev' \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $AHREFS_API_KEY"
```

Response:

```json
{
  "domain_rating": {
    "domain_rating": 20.0,
    "license": "http://ahrefs.com/legal/domain-rating-license"
  }
}
```

Print the number as **DR**. Always add attribution: **Domain Rating by Ahrefs**
(https://ahrefs.com/). License: http://ahrefs.com/legal/domain-rating-license

## Rules

- Always use this free public endpoint. Do not call paid Site Explorer
  endpoints for DR.
- Pass the host only when the user gives a full URL unless they ask for
  that exact URL as `target`.
- On `401`, the key is missing or invalid. Stop. Do not retry with a
  guessed key.
- On `429`, wait and retry once. Do not loop.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.