---
title: "CORS proxy for OEREB documents / images / XML"
description: "Server-side proxy for OEREB legal-provision documents, images and XML extracts hosted on cantonal/federal servers that do not send an `Access-Control-Allow-Origin` header (so a browser cannot fetch them directly). Fetches the target server-side and streams the bytes back binary-safe, preserving the upstream Content-Type and Content-Disposition, with permissive CORS. The target host must match an allowlist of official OEREB/cantonal/federal domains, so it cannot be used as an open relay. No token required. Replaces the discontinued public corsproxy.io / allorigins.win relays."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.aireon.ch/llms.txt
> Use this file to discover all available pages before exploring further.

Path: RES API (public) › OEREB

`GET /res_api/doc-proxy`

Server-side proxy for OEREB legal-provision documents, images and XML extracts hosted on cantonal/federal servers that do not send an `Access-Control-Allow-Origin` header (so a browser cannot fetch them directly). Fetches the target server-side and streams the bytes back binary-safe, preserving the upstream Content-Type and Content-Disposition, with permissive CORS. The target host must match an allowlist of official OEREB/cantonal/federal domains, so it cannot be used as an open relay. No token required. Replaces the discontinued public corsproxy.io / allorigins.win relays.

## Query parameters

- `url` (`getDocProxy.query.url`; string, required): URL-encoded absolute http(s) URL of the document to proxy. Host must be on the OEREB/cantonal/federal allowlist.
  - format `uri`

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://res.aireon.ch/res_api/doc-proxy?url=http%3A%2F%2Fexample.com'
```

### TypeScript

```typescript
const url = 'https://res.aireon.ch/res_api/doc-proxy?url=http%3A%2F%2Fexample.com';
const options = {method: 'GET'};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://res.aireon.ch/res_api/doc-proxy?url=http%3A%2F%2Fexample.com"

response = requests.get(url)

print(response.text)
```

## Responses

### 200

The proxied file, binary-safe, with the upstream Content-Type preserved.

#### Example

```text
string
```

### 400

Missing `url` parameter.

### 403

Target host is not on the allowlist.

### 502

Upstream fetch failed.


Source: https://docs.aireon.ch/res/get-doc-proxy/index.md
