API Reference
All API endpoints require the nodejs runtime. BigInt values are serialized as strings for JSON compatibility.
List Press Releases
GET
/api/prsReturns a paginated list of press releases with optional filters.
Query Parameters
| Param | Type | Default | Description |
|---|---|---|---|
| category | string | — | Filter by category (e.g. Technology, DeFi) |
| state | string | — | Filter by state: PendingCuration, Approved, Flagged, Rejected |
| sort | string | newest | Sort order: newest, oldest, quality |
| page | number | 1 | Page number (1-indexed) |
| limit | number | 20 | Results per page (max 100) |
Example Request
bash
curl "http://localhost:3000/api/prs?category=Technology&state=Approved&sort=newest&page=1&limit=10"Example Response
json
{
"prs": [
{
"id": 1,
"onChainId": "1",
"submitter": "0x1234...5678",
"title": "ChainPress Launches on Avalanche",
"category": "Technology",
"tags": ["blockchain", "press-release"],
"tier": "Premium",
"state": "Approved",
"qualityScore": 85,
"createdAt": "2026-05-22T12:00:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 42,
"totalPages": 5
}
}Get Press Release
GET
/api/prs/:idReturns a single press release by on-chain ID. Excludes Removed PRs.
Path Parameters
| Param | Type | Description |
|---|---|---|
| id | string (digits) | On-chain press release ID (BigInt) |
Example Request
bash
curl "http://localhost:3000/api/prs/1"Example Response
json
{
"id": 1,
"onChainId": "1",
"submitter": "0x1234...5678",
"title": "ChainPress Launches on Avalanche",
"category": "Technology",
"tags": ["blockchain", "press-release"],
"content": "## Press Release\n\nChainPress is live...",
"contentHash": "0xabc...",
"arweaveTxId": "abc123...",
"tier": "Premium",
"state": "Approved",
"qualityScore": 85,
"createdAt": "2026-05-22T12:00:00.000Z",
"updatedAt": "2026-05-22T14:00:00.000Z"
}List Curators
GET
/api/curatorsReturns a paginated list of curators with optional state filter.
Query Parameters
| Param | Type | Default | Description |
|---|---|---|---|
| state | string | — | Filter: Pending, Active, Slashed, Inactive |
| page | number | 1 | Page number |
| limit | number | 20 | Results per page |
Example Request
bash
curl "http://localhost:3000/api/curators?state=Active&page=1&limit=20"Example Response
json
{
"curators": [
{
"address": "0x1234...5678",
"stake": "500000000000000000000",
"reputation": 15,
"state": "Active",
"rewardPool": "0",
"createdAt": "2026-05-22T12:00:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 5,
"totalPages": 1
}
}Create Curator
POST
/api/curatorsCreate or update a curator record. Requires x-api-key header.
Request Body
| Field | Type | Description |
|---|---|---|
| address | string (hex) | Ethereum address of the curator |
Example Request
bash
curl -X POST "http://localhost:3000/api/curators" \
-H "Content-Type: application/json" \
-H "x-api-key: your-sync-api-key" \
-d '{"address": "0x1234...5678"}'Upload to Arweave
POST
/api/uploadUpload press release content to Arweave via Irys. Returns the Arweave transaction ID.
Request Body
| Field | Type | Description |
|---|---|---|
| content | string | Press release content (1-50000 chars) |
Example Request
bash
curl -X POST "http://localhost:3000/api/upload" \
-H "Content-Type: application/json" \
-d '{"content": "## My Press Release\n\nContent here..."}'Example Response
json
{
"arweaveTxId": "abc123def456..."
}Sync On-Chain Events
POST
/api/syncSync on-chain events to the database. Requires x-api-key header authentication. Increments the last indexed block number.
Example Request
bash
curl -X POST "http://localhost:3000/api/sync" \
-H "x-api-key: your-sync-api-key"Example Response
json
{
"success": true,
"lastBlock": "42"
}Health Check
GET
/api/healthSystem health check. Returns database connectivity status and contract addresses.
Example Request
bash
curl "http://localhost:3000/api/health"Example Response
json
{
"status": "ok",
"database": "connected",
"contracts": {
"NewsToken": "0xA2E099aCBCf1b85fA4D21dbfa5083fe65B83F9Ad",
"PRSubmission": "0x575731b0f3DA45fA9F0de75e886700DDcf440276",
"CurationEngine": "0x3f1264C0a6AFb286DA39F082D7241944d9F96cCc",
"Treasury": "0xd726D7a7eDB6eB049b2B2211A0f6506DF5A43327"
}
}