Import — MDDB API

Document import from URLs

Import document from URL #

POST /v1/import-url

Fetch content from a URL, parse YAML frontmatter if present, merge metadata, and store the document. This is a write-protected endpoint.

If key is not provided, it is derived from the URL path. YAML frontmatter metadata from the fetched content is merged with the meta parameter.

Authorization: BearerAuth or APIKeyAuth or none

Request body #

Required.

Content type application/json: ImportURLRequest

{
  "collection": "blog",
  "key": "my-post",
  "lang": "en_US",
  "meta": {
    "source": [
      "imported"
    ]
  },
  "ttl": 3600,
  "url": "https://example.com/post.md"
}

Responses #

Status Description Body
200 Document imported successfully Document (application/json)
400 Invalid request ErrorResponse (application/json)
403 Read-only mode ErrorResponse (application/json)

Import Wikipedia XML dump #

POST /v1/import-wiki

Stream and import MediaWiki XML dumps (.xml or .xml.bz2) into a collection. Automatically converts wikitext to Markdown. Streams the XML — does not load the entire file into memory. Supports namespace filtering, redirect skipping, and batch processing with progress logging.

Authorization: BearerAuth or APIKeyAuth or none

Parameters #

Name In Type Description
collection query string Target collection (for octet-stream/bzip2 uploads)
lang query string Language code (for octet-stream/bzip2 uploads)
namespaces query string Comma-separated namespace IDs (default: 0)
skipRedirects query string
skipFts query string
maxPages query integer
batchSize query integer
filename query string Filename hint for compression detection (e.g. dump.xml.bz2)

Request body #

Required.

Content type multipart/form-data: object

Property Type Description
file (required) string (binary) Wikipedia XML dump file (.xml or .xml.bz2)
collection (required) string Target collection name
lang (required) string Language code (e.g. en, de, pl)
namespaces string Comma-separated namespace IDs (default: 0 = articles only)
skipRedirects string Skip redirect pages One of "true", "false".
skipFts string Skip FTS indexing for faster bulk import One of "true", "false".
maxPages string Maximum number of pages to import
batchSize string Pages per batch commit (default: 500)
{
  "batchSize": "string",
  "collection": "string",
  "file": "string",
  "lang": "string",
  "maxPages": "string",
  "namespaces": "string",
  "skipFts": "true",
  "skipRedirects": "true"
}

Content type application/octet-stream: string (binary)

string

Content type application/x-bzip2: string (binary)

string

Responses #

Status Description Body
200 Import completed WikiImportResponse (application/json)
400 Invalid request ErrorResponse (application/json)
403 Read-only mode ErrorResponse (application/json)