# Quickstart

> Call the PDFluent hosted API with curl, Python or Node.js.

> Coming soon. The hosted API is not live yet, and this page describes the planned service as of 16 November 2026. [Get notified](https://pdfluent.com/contact/?topic=hosted) when it opens.

Source: https://pdfluent.com/docs/api/quickstart/

Set the base URL and your key once. The base URL is the one of your region.

```sh
export PDFLUENT_API_URL="<the API base URL of your region>"
export PDFLUENT_API_KEY="<your API key>"
```

Send the key in the `x-api-key` header (or as a bearer token), then call any operation. This one turns a PDF into Markdown:

### curl

```sh
curl -sS -f -X POST "$PDFLUENT_API_URL/v1/extract/markdown" \
  -H "x-api-key: $PDFLUENT_API_KEY" \
  -F file=@structured.pdf \
  -o result.md
```

### Python

```python
import json
import os

import requests

parts = [
    ("file", ("structured.pdf", open("structured.pdf", "rb"))),
]

response = requests.post(
    os.environ["PDFLUENT_API_URL"] + "/v1/extract/markdown",
    headers={"x-api-key": os.environ["PDFLUENT_API_KEY"]},
    files=parts,
)
response.raise_for_status()

with open("result.md", "wb") as out:
    out.write(response.content)
```

### Node.js

```js
import { openAsBlob } from 'node:fs';
import { writeFile } from 'node:fs/promises';

const form = new FormData();
form.append('file', await openAsBlob("structured.pdf"), "structured.pdf");

const response = await fetch(process.env.PDFLUENT_API_URL + "/v1/extract/markdown", {
  method: 'POST',
  headers: { 'x-api-key': process.env.PDFLUENT_API_KEY },
  body: form,
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);

await writeFile("result.md", Buffer.from(await response.arrayBuffer()));
```

A successful call returns the result as the body. The response headers `x-pdfluent-pages` and `x-pdfluent-credits` tell you how many pages were read and how many credits the call cost.

## Next

- [Authentication](https://pdfluent.com/docs/api/authentication/)
- [Credits and pricing](https://pdfluent.com/docs/api/credits/): what the call above cost, and how to try the API for USD 1.
- [API reference](https://pdfluent.com/docs/api/reference/): the other operations.
- [Errors](https://pdfluent.com/docs/api/errors/): what a failed call returns.
