# price

API reference to fetch an indicative price for a swap.

## GET /1.3/swap/price

> Get indicative price for a swap

```json
{"openapi":"3.0.0","info":{"title":"31Third Trading API","version":"1.3"},"tags":[{"name":"swap","description":"Calculate swaps"}],"paths":{"/1.3/swap/price":{"get":{"operationId":"SwapController_getSwapPrice","summary":"Get indicative price for a swap","parameters":[{"name":"x-api-key","in":"header","description":"31Third API key (Request via dev@31third.com)","schema":{"type":"string"}},{"name":"chain-id","in":"header","description":"Chain ID as hex string. (e.g.: 0x1 for Ethereum mainnet)","schema":{"type":"string"}},{"name":"sellToken","required":true,"in":"query","description":"Address of the sell token","schema":{"type":"string"}},{"name":"buyToken","required":true,"in":"query","description":"Address of the buy token","schema":{"type":"string"}},{"name":"sellAmount","required":true,"in":"query","description":"Sell amount in token base units (e.g. Wei for ETH)","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwapPriceDto"}}}}},"tags":["swap"]}}},"components":{"schemas":{"SwapPriceDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique ID of the calculated swap price."},"sellToken":{"description":"Sell token.","allOf":[{"$ref":"#/components/schemas/SimpleTokenDto"}]},"buyToken":{"description":"Buy token.","allOf":[{"$ref":"#/components/schemas/SimpleTokenDto"}]},"sellAmount":{"format":"int64","type":"integer","description":"Amount to sell. (In sell token units)"},"buyAmount":{"format":"int64","type":"integer","description":"Estimated buy amount. (In buy token units)"},"price":{"type":"number","description":"Price of the <code>buy</code> token in <code>sell</code> token. E.g. 1 BTC = 100.000 USD; you sell WBTC and buy USDC; the price is 0.000001"},"priceImpactBps":{"type":"number","description":"Estimated price impact in basis points. [-10_000;10_000]. > 0 = value loss. < 0 = value gain","minimum":-10000,"maximum":10000}},"required":["id","sellToken","buyToken","sellAmount","buyAmount","price","priceImpactBps"]},"SimpleTokenDto":{"type":"object","properties":{"address":{"type":"string","description":"Address of the token"},"name":{"type":"string","description":"Name of the token"},"symbol":{"type":"string","description":"Symbol of the token"},"imageUrl":{"type":"string","description":"Url of the token icon"},"decimals":{"type":"number","description":"Decimals of the token"},"sliderColor":{"type":"string","description":"Color based on the icon that can be used for elements in the frontend"},"chain":{"description":"Chain on which the token is deployed","allOf":[{"$ref":"#/components/schemas/ChainDto"}]},"tags":{"description":"Tags categorizing the token","type":"array","items":{"type":"string"}},"deflationary":{"type":"boolean","description":"Describes if this token is deflationary (e.g.: transfer fees)"}},"required":["address","name","symbol","imageUrl","decimals","sliderColor","chain","tags","deflationary"]},"ChainDto":{"type":"object","properties":{"name":{"type":"string","description":"Name of the chain"},"identifier":{"type":"string","description":"ID of the EVM base chain as hex value"},"enabled":{"type":"boolean","description":"Describes if rebalancings are enabled"},"batchTradeSupported":{"type":"boolean","description":"Describes if batch trade is supported"},"batchTradeAddress":{"type":"string","description":"Address of the deployed 31third-protocol BatchTrade contract"},"blockExplorerLink":{"type":"string","description":"Link of the most common block explorer"},"nativeTokenAddress":{"type":"string","description":"(Pseudo)-address of the chains native token"},"wrappedNativeTokenAddress":{"type":"string","description":"Address of the chains wrapped native token"},"tokenHelperAddress":{"type":"string","description":"Address of a helper contract capable of doing batch reads"},"portfolioEnabled":{"type":"boolean","description":"Describes if portfolio feature is enabled"}},"required":["name","identifier","enabled","batchTradeSupported","batchTradeAddress","blockExplorerLink","nativeTokenAddress","wrappedNativeTokenAddress","tokenHelperAddress","portfolioEnabled"]}}}}
```
