# Jina Proxy API

`/jina-proxy` is a Cloudflare Pages Function that forwards a verified request to `https://r.jina.ai/` and returns markdown.

## Purpose

Use this endpoint when you want a site-hosted markdown extraction path for an external URL and you can satisfy the human verification step.

## Methods

### `GET /jina-proxy`

Query parameters:

- `url` (required): target `http` or `https` URL
- `sitekey` (optional): if present, returns the configured Turnstile site key as JSON
- `turnstileToken` or `cf-turnstile-response` (required for content fetches)

### `POST /jina-proxy`

Accepted bodies:

- `application/json`
- `application/x-www-form-urlencoded`
- `multipart/form-data`

Supported body fields:

- `url`, `target`, or `href`
- `turnstileToken`, `turnstile_token`, `cfTurnstileResponse`, or `cf-turnstile-response`

## Response behavior

- Success: upstream markdown response from `r.jina.ai`
- Errors: JSON object with an `error` field and an HTTP 4xx or 5xx status

## Related endpoints

- OpenAPI: `/docs/api/jina-proxy/openapi.json`
- Status: `/api/status/jina-proxy`
- Resource metadata: `/.well-known/oauth-protected-resource/jina-proxy`
