{
  "openapi": "3.1.0",
  "info": {
    "title": "Brain on BNB — free trading tools for BNB Smart Chain",
    "version": "1.0.0",
    "description": "Measure a BSC token before a trade: honeypot and rug-pull read, round trip with the measured transfer tax, best PancakeSwap route at your size, fee tiers, range replay. No key. every route free; /api/pool-scan alone counts: 1,000 per caller and UTC day, past that HTTP 402 or 429 with code free_limit. Day pass: past the free pool scans: POST https://agent.brainonbnb.com/scan-pass — 0.50 USD1, half that in $BOBAI, free for a wallet holding 1,000,000 $BOBAI; then send header X-Scan-Pass (2,000 scans a pass). Measurement, not advice.",
    "contact": {
      "url": "https://brainonbnb.com/scanner"
    }
  },
  "servers": [
    {
      "url": "https://brainonbnb.com"
    }
  ],
  "paths": {
    "/api/preflight": {
      "get": {
        "operationId": "bsc_token_preflight",
        "summary": "Before every buy: can you get in and out at your size, what the round trip costs with the measured tax, who controls the contract. Branch on gate: stop | weigh | no_known_stop.",
        "description": "START HERE for any BSC token. Honeypot and rug-pull pre-trade check, measured not labelled: For an agent about to trade ANY token on BNB Smart Chain: the check to run before every trade, in one call and at YOUR size. Answers the two questions that matter before signing - can I get in, and can I get out again - and what the trip costs. Returns stop[] (facts that end an automated trade: the sell does not go through from a fresh address, nothing quotes, half the money is gone on an immediate round trip) and caution[] (facts to weigh, each with its figure and the line it was measured against: a transfer tax that is high, unknown or changeable by the owner; a size that moves the price more than 1%; a deeper pool elsewhere; LP that can still be withdrawn, and by whom - the deployer holding the LP is named - or that was already withdrawn; holders unknown or concentrated; the deployer or a wallet it funded selling into the pool (net of liquidity it added back), a top holder selling over a quarter of its balance, launch buyers holding over 10%; contract flags), then the figures: the token’s spot price in dollars from the pool read (token.price_usd), the best PancakeSwap route at this size, what you pay and receive, the slippage in bps this size really needs, per side, from the measured tax (a fee-on-transfer token reverts below its tax), the round trip with the transfer tax applied (measured from executed trades, or, when the pool has not traded in the window, simulated on chain at th",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "description": "A BSC token address, a pool/pair address, or a link containing one",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "usd",
            "in": "query",
            "required": false,
            "description": "Trade size in dollars, optional - defaults to 250",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The measurement, JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "A refusal, JSON with error, code (bad_address, not_a_token, is_wallet, bad_usd …) and hint"
          }
        },
        "x-example": "https://brainonbnb.com/api/preflight?address=0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82&usd=250"
      }
    },
    "/api/pool-scan": {
      "get": {
        "operationId": "bsc_pool_scan",
        "summary": "The full read behind the preflight: cost per size, 1% depth both ways, measured tax, sell simulation, LP custody, holders, flow, every venue.",
        "description": "The full honeypot / rug-pull / liquidity read behind bsc_token_preflight, every figure and its source. Use it when the preflight’s short answer is not enough (an audit, a dashboard, a second look at one figure); for the go/no-go before a trade call bsc_token_preflight, and for the route alone pancakeswap_best_route. Measure what a trade on BNB Smart Chain would actually cost, for ANY token or pool — before placing it. Reads the pool live from the chain and returns: real cost per trade size (price impact + swap fee + transfer tax together, not the headline slippage a router shows), the USD size that moves the price 1% in each direction, the transfer tax measured from executed trades (simulated on chain at that block when the pool has not traded in the last hour, and flagged measured:false) rather than taken from a label, how much of the token's liquidity the readable pool actually holds, and whether the LP is burned or still withdrawable — plus our own sell simulation on the router from a fresh address (sellability). A token still raising on four.meme with no pool yet is measured from four.meme's own contract instead (curve: raise progress, price, buy/sell cost per size, fee). Works on PancakeSwap V2, V3 and Infinity CL (an Infinity pool is found from its key on chain and priced by PancakeSwap's own Infinity quoter, its hook included), Uniswap V2 and V3, and Biswap; a token still on four.meme's or flap.sh's launch curve is read from that curve. Read tax.measured and tax.source",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "description": "A BSC token address, a pool/pair address, or any BscScan / DexScreener / PancakeSwap link containing one",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Scan-Pass",
            "in": "header",
            "required": false,
            "description": "Only past the free 1000 scans a day: a day pass from POST https://agent.brainonbnb.com/scan-pass",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The measurement, JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "A refusal, JSON with error, code (bad_address, not_a_token, is_wallet, bad_usd …) and hint"
          },
          "402": {
            "description": "Free pool scans for the day used: code free_limit, with the day-pass terms"
          },
          "429": {
            "description": "Free pool scans for the day used"
          }
        },
        "x-example": "https://brainonbnb.com/api/pool-scan?address=0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82"
      }
    },
    "/api/best-route": {
      "get": {
        "operationId": "pancakeswap_best_route",
        "summary": "Which PancakeSwap pool returns the most at your size (quoted by the venue), every other route, the round trip with the tax, the slippage it needs.",
        "description": "For an agent about to swap on PancakeSwap, and for the two questions it has to answer before signing. FIRST: which of the up-to-five pools the pair lives in actually returns the most AT THIS SIZE, quoted by the venue itself rather than ranked by depth - the deepest pool is regularly not the cheapest one for the trade being made. SECOND: what comes back if the proceeds are sold straight back on the same route, with the transfer tax (measured from executed trades, or simulated on chain when there was no trade to measure: transfer_tax.source says which) applied to the amounts carried between the legs, because the tax is taken outside the pool where no quoter can see it. Returns the best route, what every other route would have cost, the round trip with and without the tax, and the slippage this size really needs. It is not a safety certificate and does not use the word: it cannot see an owner who has not acted yet, and it says so.",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "description": "A BSC token address, or a PancakeSwap pool address to pin the pair",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "usd",
            "in": "query",
            "required": false,
            "description": "Trade size in dollars, optional - defaults to 250",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The measurement, JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "A refusal, JSON with error, code (bad_address, not_a_token, is_wallet, bad_usd …) and hint"
          }
        },
        "x-example": "https://brainonbnb.com/api/best-route?address=0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82&usd=250"
      }
    },
    "/api/fee-tiers": {
      "get": {
        "operationId": "pancakeswap_fee_tiers",
        "summary": "For liquidity: which fee tier of a pair actually pays, fees per $1,000 over all capital and over the capital within 2% of the price.",
        "description": "Measure which PancakeSwap fee tier of a pair actually pays liquidity providers, to decide WHERE to put liquidity. Use it before adding liquidity to a pair; once the pool is chosen use pancakeswap_range_plan for the price range, for a position you already hold use pancakeswap_position_look, and for a swap (not liquidity) use pancakeswap_best_route. Pass a token to compare all its pools against its main quote, or a pool address to pin the exact pair. A pair lives in up to five pools at once — V2 at 0.25% and V3 at 0.01%, 0.05%, 0.25% and 1.00% — and every source ranks them by the money already parked in them, which does not say which one pays. This measures each tier over a live window: swaps, turnover, the fees the pool actually paid out, and those fees per $1,000 of capital — over TWO denominators. The first is everything the pool holds, which is what every interface shows. The second is the capital standing within 2% of the current price, reconstructed by walking the tick book of the pool itself, because concentrated liquidity parked far from the price earns nothing and a new dollar only competes with the capital that is at the price. The two rankings disagree often, and both are returned. It also names tiers holding real money that did not trade at all. Measured, never annualised: the window is about an hour of chain and is reported with the answer. The same token asked again within 60 seconds gets the same measurement from the edge cache (cache.hit, cache.age_seconds). Rea",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "description": "A BSC token address (all of its PancakeSwap pools against its main quote are compared), or one PancakeSwap pool address to pin that exact pair; 0x + 40 hex",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The measurement, JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "A refusal, JSON with error, code (bad_address, not_a_token, is_wallet, bad_usd …) and hint"
          }
        },
        "x-example": "https://brainonbnb.com/api/fee-tiers?address=0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82"
      }
    },
    "/api/range-plan": {
      "get": {
        "operationId": "pancakeswap_range_plan",
        "summary": "For a V3 position: each range width replayed through the real swaps of the last hour — fees, time in range, exits. No forecast.",
        "description": "Replay real swaps to compare PRICE RANGE widths for a PancakeSwap V3 position: fees each width would have earned and how long it stayed in range. Use it after the pool is chosen (pancakeswap_fee_tiers picks the tier); for a position you already hold use pancakeswap_position_look. Read-only, free, no key. For a liquidity provider who has picked a PancakeSwap V3 pool and now has to pick a PRICE RANGE - the decision concentrated liquidity actually forces, and the one every interface answers with a preset. This does not model and does not forecast. It replays: the V3 Swap event carries the liquidity that was active when each trade went through, so a position of a stated size is walked through the swaps that really happened in a live window and asked, at each one, whether it was in range and what share of the active liquidity it was. Returns per candidate width the fees it would have collected, how much of the window it stayed in range, and how many times the price walked out. Impermanent loss is not in it, and it is worst exactly where the fees are best. The window is about an hour and travels with the answer.",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "description": "A BSC token address, or a PancakeSwap V3 pool address to pin the pool",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "capitalUsd",
            "in": "query",
            "required": false,
            "description": "Size of the position in dollars, optional - defaults to 1000. It sets your share of the active liquidity at each swap, so the fees depend on it",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "quote",
            "in": "query",
            "required": false,
            "description": "The other side of the pair, optional: BNB, USDT, USDC, USD1 or BUSD, or its address. Without it the quote with the deepest V3 pool is used, so pass it whenever a pair was named (CAKE/BNB)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The measurement, JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "A refusal, JSON with error, code (bad_address, not_a_token, is_wallet, bad_usd …) and hint"
          }
        },
        "x-example": "https://brainonbnb.com/api/range-plan?address=0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82&capitalUsd=1000&quote=BNB"
      }
    }
  }
}