Get Started with Ragily
Everything you need to integrate web search, content extraction, site crawling, research reports, document ingestion, and unified query into your application.
Quick Start
Make your first API call in under a minute. Grab your API key from the dashboard and run:
Base URL
Authentication
Authenticated endpoints require a Bearer token in the Authorization header. API keys are scoped to your account and can be managed from your dashboard.
Credits
Each API call consumes credits based on the operation:
| Endpoint | Credits |
|---|---|
POST /v1/search (basic) | 1 credit |
POST /v1/search (advanced depth) | 2 credits |
POST /v1/search + include_answer | +1 credit |
POST /v1/extract | 1 credit per 5 URLs |
POST /v1/crawl | 1 credit per 5 pages |
POST /v1/research (basic) | 5 credits |
POST /v1/research (deep) | 15 credits |
POST /v1/documents | 1 credit |
POST /v1/documents/search | 1 credit |
POST /v1/query | 2–3 credits (varies by sources + answer) |
/v1/health
Public health check endpoint. No authentication required. Returns server status, version, uptime, and timestamp.
Response
statusstringServer status: "ok", "degraded", or "error".
versionstringAPI version string.
uptimenumberServer uptime in seconds.
timestampstringCurrent server time in ISO 8601 format.
/v1/search
Search the web and return structured results with snippets, URLs, and relevance scores. Optionally include an AI-generated answer.
Request Body
querystringrequiredSearch query. 1–2000 characters.
search_depthstringdefault: "basic""basic" or "advanced". Advanced uses more credits but returns deeper results.
topicstringdefault: "general""general", "news", or "finance".
max_resultsintegerdefault: 5Maximum number of results. 1–20.
time_rangestringFilter by recency: "day", "week", "month", or "year".
include_domainsstring[]Only include results from these domains.
exclude_domainsstring[]Exclude results from these domains.
countrystringISO 3166-1 alpha-2 country code for localized results.
include_answerbooleandefault: falseInclude an AI-generated answer synthesized from results. Costs +1 credit.
include_raw_contentbooleandefault: falseInclude full raw page content for each result.
include_imagesbooleandefault: falseInclude image results.
Response
querystringThe original search query.
answerstring | nullAI-generated answer, if requested.
resultsobject[]Array of results. Each contains title, url, content (snippet), score (relevance), and optionally raw_content and published_date.
imagesstring[]Array of image URLs, if requested.
response_timenumberRequest duration in milliseconds.
usageobjectContains credits_used, credits_remaining, and optionally overage_credits.
request_idstringUnique request identifier for support.
/v1/extract
Extract clean, readable content from one or more URLs. Returns markdown or plain text via Mozilla Readability.
Request Body
urlsstring[]requiredArray of URLs to extract content from. 1–20 URLs.
extract_depthstringdefault: "basic""basic" or "detailed". Detailed extraction includes more metadata.
formatstringdefault: "markdown"Output format: "markdown" or "text".
timeoutintegerdefault: 15000Per-URL fetch timeout in milliseconds. 1000–30000.
Response
resultsobject[]Successfully extracted content. Each contains url and raw_content.
failed_resultsobject[]URLs that failed to extract. Each contains url and error message.
response_timenumberRequest duration in milliseconds.
usageobjectContains credits_used, credits_remaining, and optionally overage_credits.
request_idstringUnique request identifier for support.
/v1/crawl
Start an async crawl job. The crawler recursively follows links from the given URL, deduplicates pages via a Redis seen-set, and enforces an atomic page budget. Poll the status endpoint to retrieve results.
Request Body
urlstringrequiredThe starting URL to crawl.
max_depthintegerdefault: 1Maximum link depth to follow. 1–3.
max_pagesintegerdefault: 10Maximum number of pages to crawl. 1–100.
Response
job_idstringUnique identifier for the crawl job. Use this to poll status.
statusstringJob status: "queued".
urlstringThe starting URL.
max_depthintegerConfigured max depth.
max_pagesintegerConfigured max pages.
usageobjectContains credits_used, credits_remaining, and optionally overage_credits.
request_idstringUnique request identifier for support.
/v1/crawl/:id
Retrieve the status and results of a crawl job by its ID.
Response
job_idstringThe crawl job identifier.
urlstringThe starting URL.
statusstring"queued", "crawling", "completed", or "failed".
max_depthintegerConfigured max depth.
max_pagesintegerConfigured max pages.
total_pagesintegerNumber of pages successfully crawled so far.
total_failedintegerNumber of pages that failed to crawl.
created_atstringJob creation timestamp (ISO 8601).
completed_atstring | nullJob completion timestamp, or null if still running.
pagesobject[]Array of crawled pages. Each contains url, status, title, raw_content, depth, and crawled_at.
request_idstringUnique request identifier for support.
/v1/research
Start an async research job. The system searches, extracts, and synthesizes a structured report from multiple sources. Returns immediately with a job ID for polling.
Request Body
querystringrequiredResearch query. 1–2000 characters.
research_depthstringdefault: "basic""basic" (1 round, 5 credits) or "deep" (3 rounds, 15 credits).
Response (202)
job_idstringUnique identifier for the research job.
statusstringJob status: "queued".
querystringThe original research query.
research_depthstringThe configured depth.
usageobjectContains credits_used, credits_remaining, and optionally overage_credits.
request_idstringUnique request identifier for support.
/v1/research/:id
Retrieve the status and results of a research job. No additional credits charged.
Response
job_idstringThe research job identifier.
querystringThe original research query.
research_depthstringThe configured depth.
statusstring"queued", "researching", "completed", or "failed".
current_roundintegerCurrent research round (1-indexed).
total_roundsintegerTotal number of research rounds.
reportobject | nullThe synthesized research report, or null if not yet complete.
created_atstringJob creation timestamp (ISO 8601).
completed_atstring | nullJob completion timestamp, or null if still running.
request_idstringUnique request identifier for support.
/v1/documents
Ingest a document for semantic search. Supports two modes: send a URL via JSON, or upload a file via multipart/form-data (max 10MB). Accepted formats: .txt, .md, .pdf, .docx. The document is automatically chunked, embedded, and indexed.
Request Body (JSON)
urlstringrequiredURL of the document to fetch and ingest.
filenamestringOverride filename (used to determine file type if URL path is ambiguous).
Request Body (multipart/form-data)
fileFilerequiredThe file to upload. Max 10MB. Accepted: .txt, .md, .pdf, .docx.
Response (202)
document_idstringUnique identifier for the document.
statusstringProcessing status: "queued".
filenamestringThe document filename.
mime_typestringDetected MIME type.
file_sizeintegerFile size in bytes (0 for URL-based until processed).
usageobjectContains credits_used, credits_remaining, and optionally overage_credits.
request_idstringUnique request identifier for support.
/v1/documents/:id
Get document metadata and processing status.
Response
document_idstringThe document identifier.
filenamestringThe document filename.
mime_typestringMIME type.
file_sizeintegerFile size in bytes.
statusstring"queued", "processing", "completed", or "failed".
total_chunksintegerNumber of indexed chunks.
metadataobject | nullExtracted document metadata.
created_atstringDocument creation timestamp (ISO 8601).
completed_atstring | nullProcessing completion timestamp, or null if still running.
request_idstringUnique request identifier for support.
/v1/documents
List all documents for the authenticated API key.
Query Parameters
limitintegerdefault: 20Number of documents to return. 1–100.
offsetintegerdefault: 0Number of documents to skip.
Response
documentsobject[]Array of documents with document_id, filename, mime_type, file_size, status, total_chunks, created_at, completed_at.
totalintegerTotal number of documents.
request_idstringUnique request identifier for support.
/v1/documents/:id
Delete a document and all its indexed chunks.
Response
document_idstringThe deleted document identifier.
deletedbooleanAlways true.
request_idstringUnique request identifier for support.
/v1/documents/search
Semantic search across your ingested documents using vector similarity. Returns the most relevant document chunks.
Request Body
querystringrequiredSearch query. 1–2000 characters.
max_resultsintegerdefault: 5Maximum number of chunks to return. 1–20.
document_idsstring[]Limit search to specific document IDs (UUIDs).
Response
querystringThe original search query.
resultsobject[]Array of results. Each contains chunk_id, document_id, filename, content, chunk_index, and similarity (0–1).
usageobjectContains credits_used, credits_remaining, and optionally overage_credits.
request_idstringUnique request identifier for support.
/v1/query
Unified query across web search and your documents. Returns merged results from both sources with an optional AI-generated answer synthesized from all content.
Request Body
querystringrequiredSearch query. 1–2000 characters.
include_webbooleandefault: trueInclude web search results.
include_documentsbooleandefault: trueInclude document search results.
max_resultsintegerdefault: 5Maximum results per source. 1–20.
search_depthstringdefault: "basic""basic" or "advanced". Controls web search depth.
include_answerbooleandefault: trueGenerate an AI answer from combined web and document sources.
document_idsstring[]Limit document search to specific document IDs (UUIDs).
Response
querystringThe original query.
web_resultsobject[]Web search results. Each contains title, url, content, and score.
document_resultsobject[]Document search results. Each contains chunk_id, document_id, filename, content, chunk_index, and similarity.
answerstring | nullAI-generated answer synthesized from all sources, or null if not requested or no results found.
response_timenumberRequest duration in milliseconds.
usageobjectContains credits_used, credits_remaining, and optionally overage_credits.
request_idstringUnique request identifier for support.