API Reference
API Reference
The indexer exposes a Hono-based API server with two query interfaces: GraphQL and SQL.
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/graphql |
POST | GraphQL query endpoint |
/ |
POST | GraphQL endpoint (alias) |
/sql/:table |
GET | Direct SQL table query |
Production: https://doman-indexer.up.railway.app
Local: http://localhost:42069
GraphQL
Query Scam Votes
curl -X POST https://doman-indexer.up.railway.app/graphql \
-H "Content-Type: application/json" \
-d '{"query": "{ scamVotes { items { reporter targetId isScam } } }"}'
Query Scam Reports
curl -X POST https://doman-indexer.up.railway.app/graphql \
-H "Content-Type: application/json" \
-d '{"query": "{ scamReports { items { reporter reasonHash isScam } } }"}'
Query Users
curl -X POST https://doman-indexer.up.railway.app/graphql \
-H "Content-Type: application/json" \
-d '{"query": "{ users { items { address voteCount reportCount } } }"}'
Available Entity Types
| Entity | Fields |
|---|---|
scamVotes |
id, reporter, targetId, targetType, reasonHash, isScam, timestamp |
scamReports |
id, reporter, reasonHash, isScam, timestamp |
users |
id, address, voteCount, reportCount |
SQL
The SQL endpoint provides direct table access for quick lookups and debugging.
Query All Votes
curl https://doman-indexer.up.railway.app/sql/scam_vote
Query All Reports
curl https://doman-indexer.up.railway.app/sql/scam_report
Query Users
curl https://doman-indexer.up.railway.app/sql/user
Available Tables
| Table | Route |
|---|---|
user |
/sql/user |
scam_vote |
/sql/scam_vote |
scam_report |
/sql/scam_report |
Response Format
GraphQL
Responses follow the standard GraphQL JSON format:
{
"data": {
"scamVotes": {
"items": [
{
"reporter": "0x1234...",
"targetId": "0xabcd...",
"isScam": true
}
]
}
}
}
SQL
Responses return JSON arrays of row objects:
[
{
"id": 1,
"reporter": "0x1234...",
"targetId": "0xabcd...",
"targetType": 0,
"reasonHash": "0xef01...",
"isScam": true,
"timestamp": 1714300000
}
]
Integration with DOMAN
graph TD
subgraph Indexer["DOMAN Indexer"]
GQL["/graphql"]
SQL["/sql/*"]
end
subgraph Consumers["Data Consumers"]
Dashboard["DOMAN Dashboard"]
Extension["Browser Extension"]
External["External Tools"]
end
GQL -->|"Structured queries"| Dashboard
GQL -->|"Structured queries"| Extension
SQL -->|"Raw table data"| External
SQL -->|"Debugging"| Dashboard
The GraphQL endpoint is preferred for structured queries with filtering and pagination. The SQL endpoint is useful for quick lookups, debugging, and data exports.