Skip to main content
POST
/
portfolio
/
exchange
Connect an exchange account to your account and create a tracked portfolio
curl --request POST \
  --url https://openapiv1.coinstats.app/portfolio/exchange \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "connectionId": "binance",
  "connectionFields": {
    "apiKey": "your_exchange_api_key_here",
    "apiSecret": "your_exchange_api_secret_here"
  },
  "name": "My Binance Portfolio"
}
'
{
  "portfolioId": "a1b2c3d4e5f6...",
  "connectionId": "ethereum",
  "status": "connected"
}
10 credits per request
  • A portfolioId you can use to query portfolio data (value, coins, chart, transactions, defi, snapshot)
  • Automatic portfolio creation with visibility set to API
  • connectionId: Exchange identifier (e.g., “binance”). Use GET /exchange/support for supported exchanges.
  • connectionFields: Exchange API credentials (apiKey, apiSecret, etc.)
  • name: Custom display name for the portfolio

Authorizations

X-API-KEY
string
header
required

API key needed to access the endpoints. Example: 'demo-api-key'

Body

application/json
connectionId
string
required

The connectionId for the cryptocurrency exchange platform. Use GET /exchange/support to get the list of supported exchanges.

Example:

"binance"

connectionFields
object
required

Authentication credentials required to connect to the exchange. This object should contain the fields specified in GET /exchange/support for the given exchange.

Example:
{
"apiKey": "your_exchange_api_key_here",
"apiSecret": "your_exchange_api_secret_here"
}
name
string

Optional display name for the portfolio.

Example:

"My Binance Portfolio"

Response

Connect Exchange Portfolio

portfolioId
string
required

The unique identifier of the connected portfolio.

Example:

"a1b2c3d4e5f6..."

connectionId
string
required

The connectionId used to connect the portfolio.

Example:

"ethereum"

status
enum<string>
required

"connected" if a new portfolio was created, "existing" if the portfolio already exists.

Available options:
connected,
existing
Example:

"connected"