### HTTP Request Example for GET /v1/mirror/{address}
Source: https://docs.odinbot.io/api-documentation/api-methods/get-v1-mirror-address
This snippet demonstrates a basic HTTP GET request to the /v1/mirror/{address} endpoint. It includes essential headers like Host and x-api-key. Ensure you replace 'YOUR_API_KEY' with your actual API key.
```http
GET /v1/mirror/{address} HTTP/1.1
Host: api.odinbot.io
x-api-key: YOUR_API_KEY
Accept: */*
```
--------------------------------
### HTTP Request Example for GET /v1/auto-sell-profiles
Source: https://docs.odinbot.io/api-documentation/api-methods/get-v1-auto-sell-profiles
This snippet shows a sample HTTP GET request to the /v1/auto-sell-profiles endpoint. It includes essential headers like Host and x-api-key. Ensure you replace 'YOUR_API_KEY' with your actual API key.
```http
GET /v1/auto-sell-profiles HTTP/1.1
Host: api.odinbot.io
x-api-key: YOUR_API_KEY
Accept: */*
```
--------------------------------
### Bash cURL Example for GET /v1/auto-sell-profiles
Source: https://docs.odinbot.io/api-documentation/api-methods/get-v1-auto-sell-profiles
This example demonstrates how to make a GET request to the /v1/auto-sell-profiles endpoint using the cURL command in a bash environment. It includes the necessary URL and API key for authentication.
```bash
curl -L \
--url 'https
```
--------------------------------
### Bash cURL Example for GET /v1/mirror/{address}
Source: https://docs.odinbot.io/api-documentation/api-methods/get-v1-mirror-address
This snippet shows how to make a GET request to the /v1/mirror/{address} endpoint using the cURL command in Bash. It includes the necessary URL and API key header. Replace '{address}' with the actual address and 'YOUR_API_KEY' with your valid API key.
```bash
curl -L \
--url 'https://api.odinbot.io/v1/mirror/{address}' \
--header 'x-api-key: YOUR_API_KEY' \
```
--------------------------------
### POST /v1/mirror API Endpoint Example (JSON)
Source: https://docs.odinbot.io/api-documentation/api-methods/post-v1-mirror
Provides a JSON example for the POST request to the '/v1/mirror' endpoint. This example demonstrates a default configuration for mirroring trades, including parameters for trade size, speed, sell strategy, and various buy/sell conditions.
```json
{
"mirror": {
"tradeSizeLamports": 1,
"tradeSpeed": "Standard",
"sellStrategy": "SellAll",
"maxBuysPerMirrorPerHour": 3,
"maxBuysPerMirrorPerDay": 3,
"maxBuysPerTokenPerDay": 1,
"maxBuysPerTokenPerWeek": 5,
"allowPumpFun": true,
"snipeLaunchpadLaunches": true,
"launchpadLaunchSnipeTradeSizeSol": 0.2,
"mevProtection": "Fastest",
"degenMode": true,
"allowBuys": true,
"buyStrategy": "Constant",
"ssMinBuy": 0.05,
"ssPercent": 50,
"ssMaxBuy": 2,
"buyMode": "Instant",
"buyDipPct": 5,
"buyDipTimeoutSecs": 86400,
"crossMirrorPrevention": true,
"pfSlippage": 15,
"buyExtraTipPct": 2,
"sellExtraTipPct": 1,
"minMcUsd": 1,
"maxMcUsd": 1,
"minTokenAgeSecs": 60,
"maxTokenAgeSecs": 604800,
"onlyCopyNewPositions": true,
"address": "text",
"autoSellProfileKey": "text"
},
"save": false
}
```
--------------------------------
### Bash cURL Example for /v1/mirrors
Source: https://docs.odinbot.io/api-documentation/api-methods/get-v1-mirrors
This snippet demonstrates how to make a GET request to the /v1/mirrors endpoint using cURL in a bash environment. It includes the necessary URL and headers for authentication.
```bash
curl -L \
--url 'https://api.odinbot.io/v1/mirrors' \
```
--------------------------------
### Bash cURL Example for /v1/auto-sell-profile/{id}
Source: https://docs.odinbot.io/api-documentation/api-methods/get-v1-auto-sell-profile-id
This snippet shows how to make a GET request to the /v1/auto-sell-profile/{id} endpoint using cURL in a bash environment. It includes the necessary URL and API key headers for authentication.
```bash
curl -L \
--url 'https://api.odinbot.io/v1/auto-sell-profile/{id}' \
--header 'x-api-key: YOUR_API_KEY' \
```
--------------------------------
### API Response Example (Success)
Source: https://docs.odinbot.io/api-documentation/api-methods/get-v1-auto-sell-profiles
Example JSON response when successfully retrieving auto-sell profiles. It includes a list of profiles and a cursor for pagination.
```JSON
{
"autoSellProfiles": [],
"cursor": "text"
}
```
--------------------------------
### Example Request Body - Auto Sell Profiles
Source: https://docs.odinbot.io/api-documentation/api-methods/get-v1-auto-sell-profiles
This snippet shows an example of a request body for managing auto sell profiles.
```APIDOC
## POST /api/profiles/auto-sell
### Description
This endpoint allows for the management of auto sell profiles.
### Method
POST
### Endpoint
/api/profiles/auto-sell
### Parameters
#### Query Parameters
- **syntax** (string) - Optional - Specifies the syntax for the request.
#### Request Body
- **autoSellProfiles** (array) - Optional - A list of auto sell profiles.
- **cursor** (string) - Optional - A cursor for pagination.
### Request Example
```json
{
"autoSellProfiles": [],
"cursor": "text"
}
```
### Response
#### Success Response (200)
- **message** (string) - A success message.
#### Response Example
```json
{
"message": "Profiles updated successfully"
}
```
```
--------------------------------
### PUT /v1/mirrors/all Request Example (HTTP)
Source: https://docs.odinbot.io/api-documentation/api-methods/put-v1-mirrors-all
This snippet shows an example HTTP request for the PUT /v1/mirrors/all endpoint. It includes necessary headers such as Host, x-api-key, Content-Type, and Accept. Ensure you replace 'YOUR_API_KEY' with your actual API key.
```http
PUT /v1/mirrors/all HTTP/1.1
Host: api.odinbot.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
```
--------------------------------
### PUT /v1/mirror
Source: https://docs.odinbot.io/llms-full.txt
Start mirroring or overwrite overrides.
```APIDOC
## PUT /v1/mirror
### Description
Start mirroring a specified address or overwrite its existing overrides.
### Method
PUT
### Endpoint
/v1/mirror
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
- **address** (string) - Required - The network address of the mirror to start or update.
- **overrides** (object) - Required - An object containing the overrides to set for this mirror.
### Request Example
```json
{
"address": "example.com",
"overrides": {
"port": 80
}
}
```
### Response
#### Success Response (200)
- **message** (string) - A confirmation message.
#### Response Example
```json
{
"message": "Mirror overrides updated successfully."
}
```
```
--------------------------------
### JavaScript Fetch GET Request to Odinbot IO Controls API
Source: https://docs.odinbot.io/api-documentation/api-methods/get-v1-controls
Provides a JavaScript example using the `fetch` API to make a GET request to the Odinbot IO /v1/controls endpoint. It includes setting the necessary headers, including the API key, and parsing the JSON response.
```javascript
const response = await fetch('https://api.odinbot.io/v1/controls', {
method: 'GET',
headers: {
"x-api-key": "YOUR_API_KEY",
"Accept": "*/"
},
});
const data = await response.json();
```
--------------------------------
### POST /v1/mirrors/batch Request Example (HTTP)
Source: https://docs.odinbot.io/api-documentation/api-methods/post-v1-mirrors-batch
This snippet shows a sample HTTP request for the POST /v1/mirrors/batch endpoint. It includes necessary headers such as Host, x-api-key, Content-Type, and Accept. Ensure to replace 'YOUR_API_KEY' with your actual API key.
```http
POST /v1/mirrors/batch HTTP/1.1
Host: api.odinbot.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
```
--------------------------------
### List Auto Sell Profiles (cURL)
Source: https://docs.odinbot.io/api-documentation/api-methods/get-v1-auto-sell-profiles
Example of how to list auto-sell profiles using cURL. This command sends a GET request to the OdinBot API endpoint with the necessary API key.
```cURL
curl -X GET "https://api.odinbot.io/v1/auto-sell-profiles" \
-H "accept: application/json" \
-H "x-api-key: YOUR_API_KEY"
```
--------------------------------
### HTTP Request Example for PUT /v1/mirror
Source: https://docs.odinbot.io/api-documentation/api-methods/put-v1-mirror
This snippet demonstrates a sample HTTP PUT request to the /v1/mirror endpoint. It includes essential headers such as Host, x-api-key, and Content-Type. Ensure you replace 'YOUR_API_KEY' with your actual API key.
```http
PUT /v1/mirror HTTP/1.1
Host: api.odinbot.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
```
--------------------------------
### List Auto Sell Profiles (JavaScript)
Source: https://docs.odinbot.io/api-documentation/api-methods/get-v1-auto-sell-profiles
JavaScript code to fetch auto-sell profiles from the OdinBot API. This example uses the `fetch` API to make a GET request and handles the JSON response.
```JavaScript
async function getAutoSellProfiles(apiKey) {
const response = await fetch('https://api.odinbot.io/v1/auto-sell-profiles', {
method: 'GET',
headers: {
'accept': 'application/json',
'x-api-key': apiKey
}
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
return data;
}
// Example usage:
// const apiKey = 'YOUR_API_KEY';
// getAutoSellProfiles(apiKey).then(data => console.log(data)).catch(error => console.error('Error:', error));
```
--------------------------------
### POST /mirror
Source: https://docs.odinbot.io/llms-full.txt
Create a new mirror or overwrite an existing mirror's overrides. This endpoint allows you to start mirroring a wallet or replace its existing override settings. If a mirror with the specified address already exists, its overrides will be fully replaced. Any override fields left empty will be deleted, resetting those specific overrides to their default values.
```APIDOC
## POST /mirror
### Description
Create a new mirror or overwrite an existing mirror's overrides. Provide a Mirror object to start mirroring a wallet or replace its existing override settings. If a mirror with that address already exists, its overrides will be fully replaced. Override fields left empty will be deleted, meaning the previously existing overrides will be removed and will reset to the default values defined in your controls.
### Method
POST
### Endpoint
/mirror
### Parameters
#### Request Body
- **address** (string) - Required - Solana public key of the wallet you want to mirror. This field is mandatory and uniquely identifies the mirror entry.
- **autoSellProfileKey** (string | "override_to_empty") - Optional - Key of the auto-sell profile OdinBot should apply for this mirror only. If you supply the literal string "override_to_empty", OdinBot will remove any auto-sell profile from this mirror even when a global profile exists in Controls.
- **tradeSizeLamports** (integer) - Optional - Total lamports Odinbot spends per copy buy when no scaling strategy is in effect.
- **tradeSpeed** (string) - Optional - Selects the speed tier for copy-trades. Enum: ["Standard", "Turbo", "Godly"]
- **sellStrategy** (string) - Optional - Defines how Odinbot exits positions when the mirrored wallet sells. Enum: ["SellAll", "SellProportionally", "NoSell"]
- **maxBuysPerMirrorPerHour** (integer) - Optional - Limits how many buys Odinbot will make for a mirrored wallet within an hour.
- **maxBuysPerMirrorPerDay** (integer) - Optional - Limits the number of buys Odin will make for a mirrored wallet within a 24-hour window.
- **maxBuysPerTokenPerDay** (integer) - Optional - Maximum number of buys allowed for the same token in a 24-hour window.
- **maxBuysPerTokenPerWeek** (integer) - Optional - Maximum number of buys allowed for the same token in a 7-day window.
- **allowPumpFun** (boolean) - Optional - If `true`, OdinBot is allowed to copy trades on pump.fun.
- **snipeLaunchpadLaunches** (boolean) - Optional - If `true`, OdinBot will snipe (quickly buy) the tokens that your mirror launches (or creates) on a launchpad.
- **launchpadLaunchSnipeTradeSizeSol** (number) - Optional - Amount in SOL to spend on each launchpad snipe (independent of tradeSizeLamports).
- **mevProtection** (string) - Optional - Sets MEV protection. Enum: ["Fastest", "Balanced", "Protected"]
- **degenMode** (boolean) - Optional - Removes slippage entirely for trades not executed on Pump.fun or PumpSwap.
- **allowBuys** (boolean) - Optional - Master switch that disables all new buys when set to false. Sells remain unaffected.
- **buyStrategy** (string) - Optional - `Constant` uses tradeSizeLamports for every buy. `Scaling` calculates size from ssMinBuy, ssPercent, and ssMaxBuy. Enum: ["Constant", "Scaling"]
- **ssMinBuy** (number) - Optional - Defines the smallest trade size (in SOL) that Odinbot will execute. If your buy would be below this size, no trade will be made. (only used when `buyStrategy` is set to `Scaling`).
- **ssPercent** (number) - Optional - Percentage of the mirror's original buy size OdinBot should match.
- **ssMaxBuy** (number) - Optional - Sets the largest trade size (in SOL) that Odinbot will execute. If the calculated buy size exceeds this value, Odinbot will instead use this value for the buy size.
- **buyMode** (string) - Optional - `Instant` will copy buys instantly. `BuyTheDip` will wait for a dip after the mirror's buy before buying. `BuyTheDip` mode uses `buyDipPct` and `buyDipTimeoutSecs`. Enum: ["Instant", "BuyTheDip"]
- **buyDipPct** (number) - Optional - Only used in `BuyTheDip` mode. How much the price dips before you buy. Must be a number between 0 and 100. If empty, defaults to 5.
- **buyDipTimeoutSecs** (number) - Optional - Only used in `BuyTheDip` mode. How long to wait for a dip after your mirror buys. Max 7 days. If empty, defaults to 1 day.
- **crossMirrorPrevention** (boolean) - Optional - When enabled, only the mirrored wallet that caused the first trade of a token can trade that token until the position is closed.
- **pfSlippage** (number) - Optional - Allowed slippage (%) when buying on Pump.fun or PumpSwap.
### Request Example
```json
{
"address": "YOUR_WALLET_ADDRESS",
"tradeSizeLamports": 1000000000,
"sellStrategy": "SellAll",
"allowPumpFun": true
}
```
### Response
#### Success Response (200)
- **message** (string) - Confirmation message indicating the mirror was created or updated.
#### Response Example
```json
{
"message": "Mirror created successfully."
}
```
```
--------------------------------
### HTTP Request Example for PATCH /v1/mirror/{address}
Source: https://docs.odinbot.io/api-documentation/api-methods/patch-v1-mirror-address
This snippet shows an example HTTP request for the PATCH /v1/mirror/{address} endpoint. It includes necessary headers such as Host, x-api-key, Content-Type, and Accept. Ensure you replace 'YOUR_API_KEY' with your actual API key.
```http
PATCH /v1/mirror/{address} HTTP/1.1
Host: api.odinbot.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
```
--------------------------------
### Cloudflare Rocket Loader Error Handling Script
Source: https://docs.odinbot.io/setup-and-initialization/3.-how-to-start-using-odinbot
This JavaScript snippet injects a script into the DOM to detect potential issues with Cloudflare's Rocket Loader. If Rocket Loader is detected, it displays an informative alert message to the user, guiding them to GitBook's documentation for resolution. This is crucial for ensuring proper site functionality when using Cloudflare.
```javascript
self.__next_f.push([1, "32: [\"$\", \"script\", null, {\"suppressHydrationWarning\": true, \"data-cfasync\": \"false\", \"dangerouslySetInnerHTML\": {\"__html\": \"\\n document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\n if (Array.from(document.scripts).find(script => script.src.includes('rocket-loader.min.js'))) {\\n const alert = document.createElement('div');\\n alert.className = 'p-4 mb-4 text-sm text-red-800 rounded-lg bg-red-50 mt-8 mx-8';\\n alert.innerHTML = `\\n Error in site configuration:\\n It looks like ${window.location.hostname} has been incorrectly configured in Cloudflare. This may lead to unexpected behavior or issues with the page loading. If you are the owner of this site, please refer to GitBook's documentation for steps to fix the problem.\\n `;\\n\\n document.body.prepend(alert);\\n }\\n });\"}}]\n"]);
```
--------------------------------
### HTTP Request Example for PUT /v1/controls
Source: https://docs.odinbot.io/api-documentation/api-methods/put-v1-controls
This snippet demonstrates an example HTTP request for the PUT /v1/controls endpoint. It includes necessary headers such as Host and Content-Type. Ensure you replace 'YOUR_API_KEY' with your actual API key.
```http
PUT /v1/controls HTTP/1.1
Host: api.odinbot.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
```
--------------------------------
### GET /v1/mirror/{address}
Source: https://docs.odinbot.io/llms-full.txt
Get one mirror and overrides.
```APIDOC
## GET /v1/mirror/{address}
### Description
Retrieve details for a specific mirror, including its overrides.
### Method
GET
### Endpoint
/v1/mirror/{address}
### Parameters
#### Path Parameters
- **address** (string) - Required - The network address of the mirror to retrieve.
#### Query Parameters
None
#### Request Body
None
### Request Example
None
### Response
#### Success Response (200)
- **mirror** (object) - An object representing the mirror and its overrides.
#### Response Example
```json
{
"mirror": {
"address": "example.com",
"overrides": {
"path": "/custom/path"
}
}
}
```
```
--------------------------------
### OdinBot Trading Configuration Parameters
Source: https://docs.odinbot.io/api-documentation/api-methods/patch-v1-controls
This snippet displays a set of configuration parameters for the OdinBot trading bot. These parameters control various aspects of the bot's trading behavior, including enabling specific trading functions, setting buy and sell strategies, managing slippage, and defining market cap and token age constraints. The values provided are typical examples for a specific trading setup.
```json
{
"allowPumpFun": True,
"snipeLaunchpadLaunches": True,
"launchpadLaunchSnipeTradeSizeSol": 0.2,
"mevProtection": "Fastest",
"degenMode": True,
"allowBuys": True,
"buyStrategy": "Constant",
"ssMinBuy": 0.05,
"ssPercent": 50,
"ssMaxBuy": 2,
"buyMode": "Instant",
"buyDipPct": 5,
"buyDipTimeoutSecs": 86400,
"crossMirrorPrevention": True,
"pfSlippage": 15,
"buyExtraTipPct": 2,
"sellExtraTipPct": 1,
"minMcUsd": 1,
"maxMcUsd": 1,
"minTokenAgeSecs": 60,
"maxTokenAgeSecs": 604800,
"onlyCopyNewPositions": True
}
```
--------------------------------
### GET /v1/auto-sell-profiles
Source: https://docs.odinbot.io/faqs/6.-frequently-asked-questions
Retrieves a list of all auto-sell profiles. This endpoint is useful for getting an overview of all configured auto-sell strategies.
```APIDOC
## GET /v1/auto-sell-profiles
### Description
Retrieves a list of all auto-sell profiles.
### Method
GET
### Endpoint
/v1/auto-sell-profiles
### Parameters
#### Query Parameters
None
#### Request Body
None
### Response
#### Success Response (200)
- **profiles** (array) - A list of auto-sell profile objects.
- **id** (string) - The unique identifier for the auto-sell profile.
- **name** (string) - The name of the auto-sell profile.
- **strategy** (string) - The trading strategy associated with the profile.
#### Response Example
```json
{
"profiles": [
{
"id": "profile123",
"name": "Default Sell Strategy",
"strategy": "take_profit_10_percent"
},
{
"id": "profile456",
"name": "Aggressive Sell",
"strategy": "stop_loss_5_percent"
}
]
}
```
```