Skip to main content

REST endpoints

The REST API provides a limited HTTP interface for web clients. Most functionality is available via XRPC endpoints.

Base URL

https://api.chive.pub/api/v1

Authentication

Include your access token in the Authorization header:

Authorization: Bearer eyJhbGciOiJFUzI1NiIs...

Content types

RequestResponse
application/jsonapplication/json

Eprints

Search eprints

GET /api/v1/eprints

Search and filter eprints.

Query parameters

NameTypeDescription
qstringSearch query
fieldstringFilter by field
authorstringFilter by author DID
fromstringStart date (ISO 8601)
tostringEnd date (ISO 8601)
sortstringSort: relevance, date, citations
limitintegerResults per page (max 100)
cursorstringPagination cursor

Example

curl "https://api.chive.pub/api/v1/eprints?q=quantum+computing&field=cs.QC&limit=10"

Get eprint

GET /api/v1/eprints/:uri

Retrieve an eprint by its AT URI.

Path parameters

NameTypeDescription
uristringURL-encoded AT URI

Search (alias)

GET /api/v1/search

Alternative endpoint for searching eprints. Accepts the same parameters as GET /api/v1/eprints.


Authors

Get author eprints

GET /api/v1/authors/:did/eprints

List eprints by an author.

Path parameters

NameTypeDescription
didstringAuthor DID

Integrations

Get eprint integrations

GET /api/v1/eprints/:uri/integrations

Returns cached integration data from external platforms for an eprint. When no cached data exists, the endpoint fetches live from external APIs (GitHub, GitLab, Zenodo, Software Heritage) and caches the result for one hour.

Path parameters

NameTypeDescription
uristringURL-encoded AT URI of the eprint

Response

{
"eprintUri": "at://did:plc:abc123.../pub.chive.eprint.submission/3k5...",
"github": [
{
"type": "github",
"owner": "user",
"repo": "repo-name",
"url": "https://github.com/user/repo-name",
"stars": 42,
"forks": 8,
"language": "Python",
"description": "Repository description",
"license": "MIT",
"lastUpdated": "2025-01-15T10:30:00Z",
"topics": ["machine-learning", "nlp"]
}
],
"gitlab": [
{
"type": "gitlab",
"pathWithNamespace": "group/project",
"name": "project",
"url": "https://gitlab.com/group/project",
"stars": 5,
"forks": 2,
"description": "Project description",
"visibility": "public",
"topics": ["data-science"],
"lastActivityAt": "2025-01-10T08:00:00Z"
}
],
"zenodo": [
{
"type": "zenodo",
"doi": "10.5281/zenodo.12345",
"conceptDoi": "10.5281/zenodo.12340",
"title": "Dataset Title",
"url": "https://zenodo.org/records/12345",
"resourceType": "dataset",
"accessRight": "open",
"version": "1.0.0",
"stats": { "downloads": 150, "views": 500 }
}
],
"softwareHeritage": [
{
"type": "software-heritage",
"originUrl": "https://github.com/user/repo-name",
"archived": true,
"lastVisit": "2025-01-12T14:00:00Z",
"lastSnapshotSwhid": "swh:1:snp:abc123...",
"browseUrl": "https://archive.softwareheritage.org/browse/origin/..."
}
],
"datasets": [
{
"type": "figshare",
"doi": "10.6084/m9.figshare.12345",
"title": "Supplementary Dataset",
"url": "https://figshare.com/articles/12345",
"description": "Dataset description"
}
],
"lastUpdated": "2025-01-15T10:30:00Z"
}

All integration arrays are optional and only present when corresponding links exist in the eprint's supplementary materials. Each integration type returns data specific to its platform.


Pagination

REST endpoints use cursor-based pagination:

{
"results": [...],
"cursor": "abc123..."
}

Include the cursor in subsequent requests to fetch the next page.

Error responses

{
"error": {
"code": "NOT_FOUND",
"message": "Eprint not found",
"details": {
"uri": "at://did:plc:abc123..."
}
}
}

HTTP status codes

StatusMeaning
200Success
400Bad request
401Unauthorized
403Forbidden
404Not found
429Rate limited
500Server error

Rate limits

Rate limits apply per IP or per user:

TierRequests/minute
Anonymous60
Authenticated300

Additional functionality

For full API functionality including reviews, endorsements, governance, backlinks, and discovery, use the XRPC endpoints.

Health endpoints

Health check endpoints for monitoring and orchestration:

Liveness probe

GET /health/liveness

Returns 200 if the service is running.

Readiness probe

GET /health/readiness

Returns 200 if the service is ready to handle requests. Checks database connections and cache availability.

Well-known endpoints

GET /.well-known/did.json

Returns the service DID document for ATProto identity verification.

OpenAPI specification

The complete OpenAPI 3.1 specification is available at:

https://api.chive.pub/openapi.json

Next steps