Share tokens provide a secure way to access portfolio data from the CoinStats app through the API. This authentication method allows you to share specific portfolio information without exposing your main API credentials.

What is a Share Token?

A share token is a unique identifier that grants API access to a specific portfolio. It’s generated directly from your CoinStats portfolio and can be used to:
  • View portfolio holdings and balances
  • Access transaction history
  • Retrieve DeFi positions and staking data
  • Get portfolio performance metrics and charts
  • Add transactions to manual portfolios
Share tokens are only available for users with a Degen plan subscription. All portfolio endpoints require either a share token or proper API authentication.

Getting Your Share Token

1

Visit your CoinStats Portfolio

Go to CoinStats Portfolio and make sure you are signed in to your account.
2

Access the Share Button

In the top-right corner of the page, click on the Share button.
Share Button Location
3

Generate a Share Link

This will bring up sharing preferences for your portfolio. Fill Title and Description and Click Generate Link.
Make sure you understand the privacy implications of sharing your portfolio data before generating a link.
4

Extract the Share Token

In the generated URL, the segment following /p/ is your share token.
https://coinstats.app/p/YOUR_SHARE_TOKEN_HERE
                        ^^^^^^^^^^^^^^^^^^^^
                      This is your share token
Share Button Location
Copy only the token portion (without additional slashes or characters).

Passcode Protection

Some portfolios may be protected with an additional passcode for extra security. If a portfolio requires a passcode, include it in your requests:
curl -H "X-API-KEY: your-api-key" \
     "https://openapiv1.coinstats.app/portfolio/value?shareToken=YOUR_SHARE_TOKEN&passcode=123456"
The passcode is an optional 6-digit code that can be set when sharing a portfolio for additional privacy protection.

Using Share Tokens in API Requests

Share tokens can be provided in two ways:

Method 1: Query Parameter

Include the shareToken parameter in your query string:
curl -H "X-API-KEY: your-api-key" \
     "https://openapiv1.coinstats.app/portfolio/value?shareToken=YOUR_SHARE_TOKEN"

Method 2: Request Header

Include the share token in the sharetoken header:
curl -H "X-API-KEY: your-api-key" \
     -H "sharetoken: YOUR_SHARE_TOKEN" \
     "https://openapiv1.coinstats.app/portfolio/value"

Endpoints That Use Share Tokens

All portfolio-related endpoints require share tokens:

Security Best Practices

Error Handling

Common errors when using share tokens: