# Submit a Suggestion to Improve a Translation

`POST /suggest`

Authentication: no security requirement declared for this operation.

Request body: application/x-www-form-urlencoded (required)

Type: object

- `q` (required)
  Type: string
  
  Original text
  
  Example:
  
  ```json
  "Hello world!"
  ```

- `s` (required)
  Type: string
  
  Suggested translation
  
  Example:
  
  ```json
  "¡Hola mundo!"
  ```

- `source` (required)
  Type: string
  
  Language of original text
  
  Example:
  
  ```json
  "en"
  ```

- `target` (required)
  Type: string
  
  Language of suggested translation
  
  Example:
  
  ```json
  "es"
  ```

Responses:

- 200: Success

Content type: application/json

Type: object

Schema: [suggest-response](https://sourcey-libretranslate.pages.dev/fr/api/models/suggest-response/index.md)

- `success` (optional)
  Type: boolean
  
  Whether submission was successful

- 403: Not authorized

Content type: application/json

Type: object

Schema: [error-response](https://sourcey-libretranslate.pages.dev/fr/api/models/error-response/index.md)

- `error` (optional)
  Type: string
  
  Error message

## Examples

### cURL

```bash
curl -X POST 'https://libretranslate.com/suggest' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-raw 'q=Hello%20world%21&s=%C2%A1Hola%20mundo%21&source=en&target=es'
```

### JavaScript

```javascript
const response = await fetch('https://libretranslate.com/suggest', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: 'q=Hello%20world%21&s=%C2%A1Hola%20mundo%21&source=en&target=es',
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.post(
    'https://libretranslate.com/suggest',
    data='q=Hello%20world%21&s=%C2%A1Hola%20mundo%21&source=en&target=es'.encode('utf-8'),
    headers={
        'Content-Type': 'application/x-www-form-urlencoded',
    },
)
print(response.text)
```
