Sample Publisher Content

Demonstrating peek.json implementation across different content types

← Back to FetchRight
API Reference8 min readv2.1.0

FetchRight API Documentation

Complete REST API reference for accessing content through the FetchRight platform. This API enables AI agents and applications to respectfully access publisher content according to peek.json policies.

🚀 Quick Start

Get started with the FetchRight API in minutes. All you need is an API key and a URL to peek.json protected content.

curl -H “Authorization: Bearer YOUR_API_KEY” \
     https://api.fetchright.ai/v2/peek \
     -d “url=https://example.com/article”

Authentication

All API requests require authentication using an API key. Include your API key in the Authorization header using the Bearer token format.

Getting an API Key

  1. Sign up for a FetchRight account at https://dashboard.fetchright.ai
  2. Navigate to the API Keys section in your dashboard
  3. Generate a new API key with appropriate permissions
  4. Securely store your API key (it won’t be shown again)

Authentication Header

Authorization: Bearer YOUR_API_KEY

⚠️ Security Note: Never expose your API key in client-side code or public repositories. Use environment variables or secure key management systems.

Base URL

All API endpoints are relative to the base URL:

https://api.fetchright.ai/v2

Core Endpoints

POST /peek

Retrieve basic information about a resource according to its peek.json policy. This endpoint typically provides free access to metadata, headlines, and abstracts.

Request Parameters

ParameterTypeRequiredDescription
urlstringYesURL of the content to peek
formatstringNoResponse format: “json” or “html” (default: json)

Example Request

POST /v2/peek
Content-Type: application/json
Authorization: Bearer abc123xyz

{ "url": "https://example.com/article/ai-breakthrough-2025", "format": "json" }

Example Response

{ "success": true, "data": { "title": "Major AI Breakthrough in Natural Language Understanding", "abstract": "Researchers at Stanford unveil new architecture...", "author": "Dr. Sarah Chen", "published": "2025-08-26T10:00:00Z", "peek_policy": { "allowed_operations": [ "peek", "summarize" ], "cost_per_operation": { "summarize": 0.02 } } }, "usage": { "cost": 0, "operation": "peek" } }

POST /summarize

Generate an AI summary of the content according to the resource’s pricing policy. Costs vary by publisher and content type.

Request Parameters

ParameterTypeRequiredDescription
urlstringYesURL of the content to summarize
lengthstringNo“short”, “medium”, or “long” (default: medium)
focusstringNoSpecific aspect to focus on in summary

POST /quote

Extract and quote specific passages from content with proper attribution. Useful for research and content creation while respecting copyright.

POST /read

Access full content when permitted by the publisher’s peek.json policy. Requires appropriate licensing for most premium content.

Rate Limits

API requests are subject to rate limits to ensure fair usage and system stability:

  • Free Tier: 100 requests per hour, 1,000 requests per day
  • Pro Tier: 1,000 requests per hour, 25,000 requests per day
  • Enterprise: Custom limits based on agreement

Rate limit information is included in response headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1693123200

Error Handling

The API uses standard HTTP status codes and returns detailed error information in JSON format.

Common Error Codes

Status CodeMeaningDescription
400Bad RequestInvalid request parameters
401UnauthorizedInvalid or missing API key
403ForbiddenOperation not allowed by content policy
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server error

Error Response Format

{ "success": false, "error": { "code": "INSUFFICIENT_PERMISSIONS", "message": "Content requires premium license for full access", "details": { "available_operations": [ "peek", "summarize" ], "required_license": "premium" } } }

SDKs and Libraries

Official SDKs are available for popular programming languages:

  • JavaScript/Node.js: npm install @fetchright/sdk
  • Python: pip install fetchright-sdk
  • Go: go get github.com/fetchright/go-sdk
  • Ruby: gem install fetchright

JavaScript Example

import FetchRight from “@fetchright/sdk”

const client = new FetchRight(“your-api-key”)

const result = await client.peek(
  “https://example.com/article”
)

console.log(result.title)

Support

Need help with the API? We’re here to assist:

  • 📧 Email: api-support@fetchright.ai
  • 💬 Discord: Join our developer community
  • 📖 Docs: https://docs.fetchright.ai
  • 🐛 Issues: https://github.com/fetchright/api-issues

🤖 AI Access Information

peek: Free access to API reference and examples

read: $0.05 per page for complete documentation

code_extract: $0.03 per code snippet with syntax highlighting

embed: $0.08 per page for semantic search

rag_ingest: $0.12 per 1000 tokens for technical questions

Developer documentation with code extraction and technical query support. Check /.well-known/peek.json for detailed API policies.