---
name: genlayer-source-reachability
description: Check whether GenLayer can reach a web source, using only curl + jq (no installs, no Node, no Docker). ALWAYS check what's already verified first — exact domain, an alternative source, or a topic that's already covered — and only verify a new source if nothing fits. The verdict is GenLayer validator consensus on Studio, returned as plain JSON. Use when any agent needs to know "can GenLayer reach this source / topic?".
---

# genlayer-source-reachability

Tells you if GenLayer can reach a web source, with an on-chain verdict from GenLayer
validator consensus. You only need `curl` and `jq`. Two steps: **discover first** (free,
instant), then **verify** a new source only if nothing already covers the need.

## Step 0 — the API (fixed prod endpoint, never moves)

```bash
API="https://gym.genlayer.foundation/api/reachability"
curl -fsS "$API/health" | jq .   # expect {"ok":true}; if this fails, stop — don't guess a verdict
```

## Step 1 — discover (do this FIRST)

Check what's already verified before spending a verification. Three ways something can
already cover the need:

```bash
# a) exact domain
curl -fsS "$API/source?domain=DOMAIN" | jq '{found,accessible,verdict}'
# b) an alternative source or a topic already covered — pull the whole list and judge
curl -fsS "$API/list" | jq -r '.domains[]'
```

- (a) `found:true, accessible:true` → **done.** GenLayer can reach it.
- (b) Scan the list: is there a verified source that already covers this need — the same
  domain, an **alternative** domain serving the same data, or a **topic** already covered?
  If yes, confirm it with `curl -fsS "$API/source?domain=THAT_DOMAIN" | jq '{accessible}'`
  and use it. **done.**
- Nothing fits → Step 2.

## Step 2 — verify a new source (only if nothing fits)

You send TWO urls: the **root** (`https://DOMAIN/`, the homepage) and a **deep url**. A deep
url is a specific inner page that actually holds the answer-bearing data — one article, one
match result, one standings/stats page — not the homepage or a section index. Research it
yourself (web search or open the site, e.g. `site:DOMAIN <the exact thing you need>`) and pick
the real content page, then:

```bash
curl -fsS -m 600 -X POST "$API/verify" -H 'Content-Type: application/json' \
  -d '{"domain":"DOMAIN","root_url":"https://DOMAIN/","deep_url":"DEEP_URL"}' \
  | jq '{accessible,root,deep,consensus,child}'
```

Runs on Studio, takes a few minutes. Read the result:
- `accessible:true` → GenLayer can reach it.
- `root`/`deep` = `"WALL"` → reachable but not usable (paywall / login / anti-bot / empty).
- `inconsistent:true` → validators disagreed; treat as not reliably reachable.
- `status:"pending"` → still finalizing on-chain; re-check with Step 1
  (`curl -fsS "$API/source?domain=DOMAIN"`) every ~20s until `accessible` is set.

Once it finishes it's saved, so Step 1 finds it next time.

If your own `curl`/search can't open the site, that says nothing about GenLayer — only the
Step 2 Studio check decides.

## Never

- Decide reachability yourself / off-chain — only the Studio verdict counts.
