Getting Started
Your First API Call

Your First API Call

Let's walk through making your first verification request step by step.

What We'll Verify

We'll verify this text:

"Albert Einstein developed the theory of relativity. He was born in Germany in 1879."

Step 1: Prepare Your Request

You'll need:

  • Your API key (from your welcome email)
  • The text to verify
  • Optionally, a verification mode

Step 2: Make the Request

import requests
 
API_KEY = "gn_live_your_key_here"
API_URL = "https://api.glyphnet.io/v1/verify"
 
response = requests.post(
    API_URL,
    headers={
        "X-API-Key": API_KEY,
        "Content-Type": "application/json"
    },
    json={
        "text": "Albert Einstein developed the theory of relativity. He was born in Germany in 1879.",
        "mode": "flagging"
    }
)
 
if response.status_code == 200:
    result = response.json()
    print(f"Total claims: {result['summary']['total_claims']}")
    print(f"Verified: {result['summary']['verified']}")
 
    for claim in result['claims']:
        status = "✓" if claim['verified'] else "✗"
        print(f"{status} {claim['text']} (confidence: {claim['confidence']})")
else:
    print(f"Error: {response.status_code}")
    print(response.json())

Step 3: Understand the Response

{
  "request_id": "req_7f8a9b0c1d2e",
  "mode": "flagging",
  "claims": [
    {
      "text": "Albert Einstein developed the theory of relativity",
      "verified": true,
      "confidence": 0.98,
      "source": "physics/relativity",
      "path": ["einstein", "developed", "relativity"],
      "evidence": "Einstein published the special theory of relativity in 1905"
    },
    {
      "text": "He was born in Germany in 1879",
      "verified": true,
      "confidence": 0.95,
      "source": "biography/einstein",
      "path": ["einstein", "born", "germany", "1879"],
      "evidence": "Einstein was born in Ulm, Germany on March 14, 1879"
    }
  ],
  "summary": {
    "total_claims": 2,
    "verified": 2,
    "unverified": 0,
    "avg_confidence": 0.965
  },
  "flagged": false,
  "blocked": false,
  "processing_time_ms": 67
}

What the Response Means

Claims Array

Each claim extracted from your text gets its own entry:

  • text - The claim that was extracted
  • verified - Whether it matches the knowledge graph
  • confidence - How certain the verification is (0.0 to 1.0)
  • source - Which part of the knowledge graph matched
  • evidence - Supporting information from the graph

Summary

Aggregate statistics:

  • total_claims - How many claims were found
  • verified - How many were verified as true
  • unverified - How many couldn't be verified
  • avg_confidence - Average confidence across all claims

Flags

  • flagged - True if any claims are unverified
  • blocked - True if mode: "blocking" and verification failed

Common Issues

401 Unauthorized

Your API key is missing or invalid. Check:

  • The key is in the X-API-Key header
  • No extra spaces or quotes around the key
  • The key hasn't been revoked

429 Too Many Requests

You've hit your rate limit. Check your plan's limits:

  • Free: 60 requests/minute
  • Starter: 200 requests/minute
  • Professional: 500 requests/minute
  • Enterprise: 2,000 requests/minute

400 Bad Request

The request body is malformed. Ensure:

  • text field is present and is a string
  • JSON is valid
  • Content-Type header is application/json

Next Steps

Now that you've made your first call: