## Exchanges API Documentation
### Limit
- I have a system that show me how many request you did so just don't DDOS the backend and it'll be fine. I'll remove any API key that does too much requests after a warning.
### Endpoint
- **URL**: `POST https://api.cathero.tools/exchange/get_exchanges/`
### Headers
- **Content-Type**: `application/json`
- **X-API-KEY**: `{Your_API_Key}` (API Key required for authentication)
### JSON Payload (All parameters are optional)
| Parameter | Type | Description | Possible Values |
|-----------------|---------|------------------------------------------------------------|---------------------------------------------|
| `day` | int | Number of days from when the item was listed ( 7 if not specified ) | Any positive integer |
| `rarity` | string | Rarity of the item | `"common"`, `"uncommon"`, `"rare"`, `"epic"`, `"legendary"` |
| `type` | string | Type of the item | `"gloves"`, `"shoes"`, `"scarf"`, `"hat"` |
| `level` | int | Level of the item (range: 0-9) | 0 to 9 |
| `durability` | int | Durability of the item (range: 0-3) | 0 to 3 |
| `max_price` | int | Maximum price wanted | 0 to 100K |
| `exchange_left` | int | Number of exchanges left | 0 to 3 |
| `order_by` | string | Criteria for sorting results (can be prefixed with `-` for descending order) | - `"price"`, <br>- `"listing_time"`,<br>- `"level"`,<br>- `"-price"`,<br>- `"-listing_time"`,<br> - `"-level"` |
### Response
- **Format**: JSON object where each key is the UUID of the exchange entry and each value is an object containing the details of the exchange.
#### Example Python Code
```python
import requests
import json
url = "https://api.cathero.tools/exchange/get_exchanges/"
payload = json.dumps({
"day": 7,
"rarity": "common",
"type": "gloves",
"level": 0,
"durability": 1,
"exchange_left": 3,
"order_by": "price"
})
headers = {
'X-API-KEY': 'your_api_key',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.json())
```
#### Example JSON Output
```json
{
"1f69ab1c-9949-4d10-8170-8c52772f8c39": {
"price": "550.00",
"listing_time": "2024-04-16T14:54:02Z",
"gear_type": "gloves",
"rarity": "common",
"level": 0,
"exchange_left": 3,
"durability": 1
},
"ef508b9b-653b-4e03-bd5c-512948d0945b": {
"price": "600.00",
"listing_time": "2024-04-16T19:19:40Z",
"gear_type": "gloves",
"rarity": "common",
"level": 0,
"exchange_left": 3,
"durability": 1
}
}
```