Skip to main content

Query Detail

developer
GET/v1/history/queries/:id

Returns the complete request and response details for a specific historical API query, identified by its unique query ID (qh_* format). Includes the full request parameters, response summary, HTTP status, latency breakdown, cache status, Cloudflare colo/country metadata, and the originating IP address and user agent.

What It Does

Fetches detailed information about a single API request by its ID. Verifies organization ownership before returning data (queries are scoped to your org). Returns all request metadata including parameters sent, response summary, error codes, performance timing, API key used, trace ID for distributed tracing, and Cloudflare edge location (colo) that served the request.

Why It's Useful

Essential for incident response workflows where you need to reconstruct exactly what happened during a specific API call. Provides the forensic detail needed to differentiate between client-side errors (wrong parameters), server-side issues (5xx errors), and network problems (timeout patterns). The Cloudflare colo metadata helps identify region-specific failures.

Use Cases

Developer / SRE

Error Root Cause Analysis

A monitoring alert fires for a specific failed API call (request_id from error logs). Retrieve the full query detail to see exact request parameters, the error code returned, response time, and which Cloudflare edge location handled the request to determine if the issue is regional or global.

Reconstruct the full context of any API failure without needing to reproduce it, cutting MTTR significantly.

QA Engineer

Response Verification & QA

After deploying a new integration, verify that specific API calls returned the expected data structure and status codes. Compare actual response summaries against expected values in automated test validation.

Validate API integration behavior against real production responses without mocking.

Security Analyst / Compliance Officer

Security Incident Forensics

During a security investigation, retrieve the full audit trail for suspicious API activity — including originating IP address, user agent, API key used, and exact data accessed. Cross-reference with your SIEM for correlation.

Immutable forensic evidence for security incidents, satisfying SOC 2 CC7.3 incident response documentation requirements.

Parameters

NameTypeRequiredDescription
domainstringRequiredQuery ID (qh_* format) from the query history listExample: qh_m1abc123_def456gh

Response Fields

FieldTypeDescription
query.idstringUnique query identifier (qh_* format)
query.endpointstringAPI endpoint path called (e.g., /v1/dns/lookup)
query.methodstringHTTP method (GET, POST, etc.)
query.targetstringTarget domain or resource queried
query.request_paramsobjectFull request parameters sent
query.status_codenumberHTTP response status code
query.response_summaryobjectSummarized response data
query.error_codestringError code if request failed (null on success)
query.response_time_msnumberTotal response time in milliseconds
query.cache_hitbooleanWhether the response was served from cache
query.cost_microsnumberRequest cost in microcents
query.request_idstringUnique request identifier for tracing
query.trace_idstringDistributed trace ID (OpenTelemetry compatible)
query.api_key_idstringAPI key that authenticated the request
query.ip_addressstringOriginating client IP address
query.user_agentstringClient user agent string
query.cf_colostringCloudflare edge location (IATA code) that served the request
query.cf_countrystringCountry of the requesting client (ISO 3166-1 alpha-2)
query.created_atstringISO 8601 timestamp of when the query was made

Code Examples

cURL
curl "https://api.edgedns.dev/v1/history/queries/:id" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d "domain=qh_m1abc123_def456gh"
JavaScript
const response = await fetch(
  'https://api.edgedns.dev/v1/history/queries/:id?domain=qh_m1abc123_def456gh',
  {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  }
);

const data = await response.json();
console.log(data);
Python
import requests

response = requests.get(
    'https://api.edgedns.dev/v1/history/queries/:id',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    params={
    'domain': 'qh_m1abc123_def456gh'
    }
)

data = response.json()
print(data)

Read the full Query Detail guide

Why it matters, real-world use cases, parameters, response fields, and how to call it from Claude, ChatGPT, or Gemini via MCP.

Read the guide →

Related Endpoints

External References

Learn more about the standards and protocols behind this endpoint.

Try This Endpoint

Test the Query Detail endpoint live in the playground.