---
title: "Query the CrawlDB"
method: POST
path: "/db/crawldb"
tags: ["Database"]
---

# Query the CrawlDB

`POST /db/crawldb`

Executes a query against the Nutch CrawlDB. The type field in the request body determines the operation: stats, dump, topN, or url. The stats and url types return JSON; dump and topN return binary octet-stream data.

## Request body

- DbQuery — Parameters for a CrawlDB query.
  - `confId` string — Configuration ID. Falls back to "default" if not provided.
  - `type` 'stats' | 'dump' | 'topN' | 'url', required — The type of CrawlDB query to execute.
  - `args` object — Additional arguments for the query.
  - `crawlId` string, required — The crawl identifier.

## Response `200`

Query results. Content type varies by query type: application/json for stats and url queries; application/octet-stream for dump and topN queries.

- object — CrawlDB query result (returned for stats and url query types).

## Other responses

- `400` — Bad request. The request body is missing, malformed, or contains invalid parameters.
- `401` — Unauthorized. Basic authentication credentials are missing or invalid.
- `500` — An unexpected server error occurred.

---

[API](https://skmtc.dev/apache/apis/apache-nutch-rest-api.md) · [All operations](https://skmtc.dev/apache/apis/apache-nutch-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/apache/apache-nutch-rest-api/revisions/e67af5b75ede/schema)
