# BrainDex Integration Quickstart

### Requesting a Route

Route requests for our pathfinder algorithm are processed through our API endpoint via JSON-formatted POST requests.

#### Sample CURL request

```bash
curl -X POST https://api.braindex.io/app/myAppId \
    -H "Content-Type: application/json" \
    -d '{
	    	"chain_id":1284,
	    	"amount_in":"0x0579a814e10a740000",
	    	"token_in":"0xAcc15dC74880C9944775448304B263D191c6077F",
	    	"token_out":"0x818ec0a7fe18ff94269904fced6ae3dae6d6dc0b",
	    	"max_hops":3,
	    	"min_splits":0,
	    	"max_splits":3,
	    	"count":5
    	}'
```

#### Sample Response

Route request responses are JSON-formatted packets consisting of three echoed entries (`token_in`, `token_out`, and `amount_in`), and three computed entries (`amount_out`, `swap_paths`, and `swap_viz_data`).

```json
{
    "token_in":"0xacc15dc74880c9944775448304b263d191c6077f",
    "token_out":"0x818ec0a7fe18ff94269904fced6ae3dae6d6dc0b",
    "amount_in":"0x579a814e10a740000",
    "amount_out":"0x203c06b",
    "swap_paths":"0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000053392e0a296bb0000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000b929914b89584b4081c7966ac6287636f7efd0530000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000818ec0a7fe18ff94269904fced6ae3dae6d6dc0b00000000000000000000000000000000000000000000000000000000000f36880000000000000000000000000000000000000000000000004615343e73b90000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000fc422eb0a2c7a99bad330377497fd9798c9b10010000000000000000000000008273de7090c7067f3ae1b6602eedbd2dbc02c48f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a649325aa7c5093d12d6f98eb4378deae68ce23f00000000000000000000000000000000000000000000000000000000000f3688000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000818ec0a7fe18ff94269904fced6ae3dae6d6dc0b0000000000000000000000000000000000000000000000000000000000000000",
    "swap_viz_data":[
        {
            "route_tokens":["0xacc15dc74880c9944775448304b263d191c6077f","0x818ec0a7fe18ff94269904fced6ae3dae6d6dc0b"],
            "route_protocols":["Beamswap"],
            "route_percent":95
        },
        {
            "route_tokens":["0xacc15dc74880c9944775448304b263d191c6077f","0xa649325aa7c5093d12d6f98eb4378deae68ce23f","0x818ec0a7fe18ff94269904fced6ae3dae6d6dc0b"],
            "route_protocols":["Beamswap", "Beamswap"],
            "route_percent":5
        }
    ]
}
```


---

# 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://braindex.gitbook.io/braindex-documentation/developer-documentation/braindex-integration-quickstart.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.
