Everything you need to integrate Moresq.
npm install @moresq/sdkOr use the REST API directly — no SDK needed.
All API calls require an API key. Pass it via the Authorization header or X-API-Key header.
# Option 1: Authorization header
curl -H "Authorization: Bearer qr_your_key" ...
# Option 2: X-API-Key header
curl -H "X-API-Key: qr_your_key" ...Resolve a single field from multiple source observations.
| Field | Type | Required | Description |
|---|---|---|---|
| field | string | Yes | Field name being resolved |
| observations | array | Yes | Array of source observations |
| strategy | string | No | majority | weighted | recency | bayesian |
| field_type | string | No | numeric | categorical | text | boolean | date |
| tolerance | number | No | Custom tolerance (0-1). Default: 0.05 for numeric |
| Field | Type | Description |
|---|---|---|
| source | string | Source identifier |
| value | any | The observed value |
| observed_at | string? | ISO 8601 date |
| reliability | number? | Pre-assigned reliability (0-1) |
const result = await fetch('https://api.moresq.com/v1/resolve', {
method: 'POST',
headers: {
'Authorization': 'Bearer qr_your_key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
field: 'length_overall',
strategy: 'weighted',
observations: [
{ source: 'api_a', value: 45.2, observed_at: '2026-03-15', reliability: 0.9 },
{ source: 'api_b', value: 45.0, observed_at: '2026-03-10', reliability: 0.7 },
{ source: 'api_c', value: 45.2, observed_at: '2026-02-28', reliability: 0.8 },
{ source: 'api_d', value: 46.1, observed_at: '2025-12-01', reliability: 0.3 },
]
})
})Resolve multiple fields for an entity in one call. Each field counts as one resolution.
{
"entity_id": "yacht_123",
"fields": [
{
"field": "loa",
"observations": [
{ "source": "a", "value": 45.2 },
{ "source": "b", "value": 45.0 }
]
},
{
"field": "builder",
"field_type": "categorical",
"observations": [
{ "source": "a", "value": "Feadship" },
{ "source": "b", "value": "Feadship" }
]
}
]
}majorityMost common value wins. Groups observations by agreement (respecting tolerance), picks the largest group.
Best for: Static data where source count matters more than recency.
weighteddefaultSources weighted by reliability and recency. The value backed by the highest total weight wins. Default strategy.
Best for: Most use cases. Balances reliability, recency, and agreement.
recencyMost recent observation wins, unless it contradicts the majority (safety check).
Best for: Rapidly changing data (prices, positions, status).
bayesianFull probabilistic inference. Computes posterior probability for each value group. Calibrated confidence — never overconfident.
Best for: When you have strong priors or need precise confidence intervals. Pro engine.
ensembleRuns all 4 strategies simultaneously, then meta-consensus on the results. If all agree → highest confidence. If they disagree → flags uncertainty.
Best for: Maximum accuracy. When getting it right matters more than speed. Pro engine.
catdCATD (Confidence-Aware Truth Discovery). Academic algorithm from VLDB 2015. Uses EM convergence to auto-discover source reliability from scratch.
Best for: When you don't know which sources to trust. Moresq figures it out. Pro engine.
POST /v1/resolve/geoGeospatial consensus. Send GPS coordinates from multiple sources — get the geometric median + outlier detection. Uses Weiszfeld algorithm + DBSCAN clustering.
POST /v1/resolve/pricesMulti-currency price consensus. Send prices in $, €, £ — auto-converts to base currency then reconciles. Handles "$15M", "€14.2M", "£12.5 million".
POST /v1/resolve/datesDate granularity-aware consensus. "2015" and "2015-03-22" are compatible — picks the most precise date consistent with the majority.
For large datasets, upload a CSV or connect your database. Moresq processes in the background.
POST /v1/jobs/csvUpload CSV with columns: entity_id, field, source, value. Returns a job_id. Poll status at GET /v1/jobs/:id. Download results at GET /v1/jobs/:id/csv.
POST /v1/jobs/dbConnect your Supabase or PostgreSQL. Specify table, entity column, source column, and fields. Moresq reads, reconciles, and optionally writes results back to a new table.
// Connect Supabase
curl -X POST api.moresq.com/v1/jobs/db \
-H "X-API-Key: qr_..." \
-d '{
"connection_string": "postgresql://...@db.xxx.supabase.co:5432/postgres",
"table": "my_scraped_data",
"entity_column": "product_id",
"source_column": "scraper_name",
"fields": ["price", "name", "year"],
"engine": "pro",
"write_back": true,
"output_table": "my_clean_data"
}'Pay for what you use. Balance headers X-Moresq-Balance andX-Moresq-Cost are included in every response.
| Engine | Cost per resolution | Strategies |
|---|---|---|
| Core | €0.002 | majority, recency |
| Pro | €0.005 | + weighted, bayesian, ensemble, catd, huber |
Free: €5 credit at signup. Pro subscription: €19/month (5,000 Pro resolutions). Wallet: top up anytime.
The core engine is open-source (MIT). Run it yourself with zero dependencies.
# Use the engine directly (no API server)
npm install @moresq/engine
# Or run the full API server in Docker
docker run -p 4400:4400 -v moresq-data:/app/data moresq/api