This site is not affiliated with or endorsed by Cloudflare, Inc. It showcases deployable experiments across most Cloudflare products.
Network & Monitoring

Radar One Question

Ask Cloudflare Radar one fact about a domain rank or ASN org/location - Internet intelligence API demo for agents

One-shot Cloudflare Radar lookup for agents and tools: ask for a domain's global rank or an ASN's organization and location. Useful as an Internet-intelligence building block without pulling the full Radar API surface.

API Reference

GET /radar

Returns one fact from Cloudflare Radar: domain ranking or ASN details.

Parameters

Provide one of:

  • domain string - Domain name (e.g., cloudflare.com)
  • asn string - ASN number with or without AS prefix (e.g., 13335 or AS13335)

Example request (domain)

curl https://radar-one-question.example.workers.dev/radar?domain=cloudflare.com

Example response

{
  "type": "domain",
  "target": "cloudflare.com",
  "fact": "Domain rank in global top domains",
  "ranking": 150
}

Example request (ASN)

curl https://radar-one-question.example.workers.dev/radar?asn=13335

Example response

{
  "type": "asn",
  "target": "AS13335",
  "fact": "ASN owned by Cloudflare, Inc. (CLOUDFLARENET) in US"
}

Error responses

  • 400 - Missing both domain and asn, or both provided
  • 502 - Radar API error or unreachable

Error codes

  • MISSING_PARAMETER - Neither domain nor asn provided
  • INVALID_PARAMETER - Both domain and asn provided
  • RADAR_ERROR - Cloudflare Radar API returned an error

Use Cases

  • Domain reputation and ranking lookups from the edge
  • ASN ownership and geolocation queries
  • Network research tools and dashboards
  • Educational demos of Cloudflare Radar capabilities
  • Threat intelligence and abuse investigation workflows

Limitations

  • Returns one fact per request (either domain ranking or ASN details)
  • Domain ranking data reflects Cloudflare Radar's public dataset
  • ASN details depend on Radar's entity database
  • No persistent storage or caching
  • Rate limits determined by Cloudflare Radar API

Use in your project

Copy these files into an existing Worker. Prefer Deployment to try the full experiment first. Source: apps/experiments/radar-one-question.

DependenciesNoneBindingsNonePlatformFetch API, Cloudflare Radar API
export async function getRadarFact(  domain?: string,  asn?: string): Promise<{ type: string; target: string; fact: string; ranking?: number }> {  if (domain) {    const response = await fetch(      `https://api.cloudflare.com/client/v4/radar/ranking/domain/${encodeURIComponent(domain)}`    );    if (!response.ok) {      throw new Error(`Radar API error: ${response.status}`);    }    const data = (await response.json()) as {      success: boolean;      result?: { rank: number };    };    if (!data.success || !data.result) {      throw new Error("Radar API returned unsuccessful response");    }    return {      type: "domain",      target: domain,      fact: `Domain rank in global top domains`,      ranking: data.result.rank,    };  }  if (asn) {    const asnNumber = asn.startsWith("AS") ? asn.substring(2) : asn;    const response = await fetch(      `https://api.cloudflare.com/client/v4/radar/entities/asns/${asnNumber}`    );    if (!response.ok) {      throw new Error(`Radar API error: ${response.status}`);    }    const data = (await response.json()) as {      success: boolean;      result?: { asn: { name: string; orgName: string; country: string } };    };    if (!data.success || !data.result) {      throw new Error("Radar API returned unsuccessful response");    }    const { name, orgName, country } = data.result.asn;    return {      type: "asn",      target: `AS${asnNumber}`,      fact: `ASN owned by ${orgName} (${name}) in ${country}`,    };  }  throw new Error("No domain or ASN provided");}

Deployment

Deploy to Cloudflare Workers

Deploy to Cloudflare Workers

No bindings or secrets required.

Test your deployment

curl "https://radar-one-question.your-subdomain.workers.dev/radar?domain=cloudflare.com"

Or query an ASN:

curl "https://radar-one-question.your-subdomain.workers.dev/radar?asn=13335"

Local Development

cd apps/experiments/radar-one-question
npm install
npm run dev

The Worker runs at http://localhost:8787.

Test locally

curl "http://localhost:8787/radar?domain=cloudflare.com"

Cloudflare Features Used

Next Steps

On this page