# JSON API

### Getting Started

Start by creating an export token (API key) in Boatvertizer. Go to "Tools > JSON-Export".

### Basic Structure

The JSON delivers all ads in the data array. Each ad contains various attributes, presented in both formatted and raw value. We recommend using the raw values for filtering and formatted values for the user output. The formatted values are translated into the selected output [language](#language) (see further below), the raw values are not affected by the language settings.

```json
{
  "status": "ok",
  "count": 12,
  "data": [
    {
      "id": 7898,
      "status": {
        "formatted": "active",
        "value": "active"
      },
      "new_or_used": {
        "formatted": "Used Boat",
        "value": "usedboat"
      },
      "boat_category": {
        "formatted": "Power Boat",
        "value": "power"
      },
      "boat_type": {
        "formatted": "Motor Yacht",
        "value": [
          "motoryacht"
        ]
      },
      "title": {
        "formatted": "Princess 50 Fly",
        "value": "Princess 50 Fly"
      },
      "price": {
        "formatted": "EUR 500.000",
        "value": 500000,
        "currency": "EUR"
      },
```

#### Field labels

The JSON also contains a fields array with a translated description of all attributes. You can use those field labels to display the data in various languages in your application. The field labels are also translated according to your [language](#language) parameter.

```json
"fields": {
        "status": "Status",
        "advert_type": "Advert Type",
        "boat_category": "Category",
        "boat_type": "Type",
        "title": "Title",
        "price": "Asking Price",
```

### Language

You can set the language with the GET parameter **lan** in the URL of the JSON request.

#### Available languages

`en, de, fr, it, es, pt, nl, dk, se, fi, no, pl`

### Images

The fotos are listed in an array inside of each ad:

```json
"fotos": [
                {
                    "url": "https://static.boatvertizer.com/fotos/qwerty/123456-large.jpg",
                    "width": 1024,
                    "height": 575,
                    "caption": "",
                    "description": ""
                },
```

You can rewrite the **-large** suffix in the URL to the desired [image size](/embed-ads-on-your-website/image-sizes.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.boatvertizer.com/embed-ads-on-your-website/json-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
