API Documentation

Get API Key

Introduction

The xcr.sh API enables you to verify creator identities and content credentials programmatically. Use it to build trust into your platform by validating content authenticity.

Base URL: https://xcr.sh/api/v1

Authentication

Public verification endpoints are available without authentication. For higher rate limits and additional features, include your API key in the request header.

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://xcr.sh/api/v1/verify/creator/handle

Endpoints

GET/verify/creator/{handle}

Verify a creator's identity and get their public key for signature verification.

Parameters

handle(path)-The creator's unique handle

Response Example

{
  "valid": true,
  "creator": {
    "handle": "johndoe",
    "displayName": "John Doe",
    "verificationLevel": 2,
    "publicKey": "-----BEGIN PUBLIC KEY-----...",
    "did": "did:xcr:abc123...",
    "platforms": [
      {
        "platform": "twitter",
        "platformHandle": "johndoe",
        "verified": true
      }
    ],
    "createdAt": "2024-01-15T10:30:00Z"
  }
}
POST/verify/content

Verify a content credential by its SHA-256 hash.

Parameters

contentHash(body)-SHA-256 hash of the content (64 characters)

Response Example

{
  "valid": true,
  "found": true,
  "credential": {
    "id": "cred_abc123",
    "contentHash": "e3b0c44298fc...",
    "contentType": "image",
    "createdAt": "2024-01-20T14:00:00Z",
    "metadata": {
      "title": "My Artwork",
      "aiGenerated": false
    }
  },
  "creator": {
    "handle": "johndoe",
    "displayName": "John Doe",
    "avatarUrl": "https://...",
    "did": "did:xcr:abc123...",
    "verificationLevel": 2
  }
}
GET/verify/creator/{handle}/key

Get only the public key for a creator (minimal response for verification).

Parameters

handle(path)-The creator's unique handle

Response Example

{
  "handle": "johndoe",
  "publicKey": "-----BEGIN PUBLIC KEY-----...",
  "did": "did:xcr:abc123...",
  "verificationLevel": 2
}

Verification Levels

Creator verification levels indicate the degree of identity verification completed.

0

Unverified

Account created but no verification completed

1

Email Verified

Email address has been verified

2

Platform Verified

At least one social platform connected and verified

3

Human Verified

Biometric verification completed

4

Professional

Additional professional credentials verified

Code Examples

JavaScript / TypeScript

async function verifyCreator(handle: string) {
  const res = await fetch(
    `https://xcr.sh/api/v1/verify/creator/${handle}`
  );
  const data = await res.json();

  if (data.valid) {
    console.log(`Verified: ${data.creator.displayName}`);
    console.log(`Level: ${data.creator.verificationLevel}`);
  }

  return data;
}

Python

import requests

def verify_creator(handle: str) -> dict:
    response = requests.get(
        f"https://xcr.sh/api/v1/verify/creator/{handle}"
    )
    data = response.json()

    if data.get("valid"):
        print(f"Verified: {data['creator']['displayName']}")
        print(f"Level: {data['creator']['verificationLevel']}")

    return data

Ready to Get Started?

Create a creator account to get your API key and start verifying content authenticity.