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.

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 
Copy only the token portion (without additional slashes or characters).
/p/
is your share token.
Passcode Protection
Some portfolios may be protected with an additional passcode for extra security. If a portfolio requires a passcode, you can include it in your requests using either query parameters or headers (recommended):Method 1: Header (Recommended)
Method 2: Query Parameter
The passcode is an optional 6-digit code that can be set when sharing a portfolio for additional privacy protection. Headers are recommended for better security as they keep sensitive information out of URL logs.
Using Share Tokens in API Requests
Share tokens can be provided in two ways, and passcode can be included using either method:Method 1: Query Parameter
Include theshareToken
parameter in your query string:
Method 2: Request Header (Recommended)
Include the share token in thesharetoken
header:
Hybrid Approach
You can also mix query parameters and headers:Headers take precedence over query parameters when both are provided for the same value.
Endpoints That Use Share Tokens
All portfolio-related endpoints require share tokens:Portfolio Value
Get comprehensive portfolio profit/loss data and metrics
Portfolio Holdings
View all coins in your portfolio with current holdings and PnL
Portfolio Chart
Historical performance data for portfolio visualization
Transaction History
Complete transaction history with filtering options
Add Transaction
Add new transactions to manual portfolios
DeFi Positions
Staking, liquidity pools, and yield farming data
Portfolio Snapshots
Historical portfolio snapshot data over time
Security Best Practices
Protect Your Share Tokens with Passcode
Protect Your Share Tokens with Passcode
Monitor Portfolio Access
Monitor Portfolio Access
- Keep track of where you’ve shared your portfolio links
- Consider using passcode protection for sensitive portfolios
Error Handling
Common errors when using share tokens:Missing Share Token
Missing Share Token
Invalid Share Token
Invalid Share Token
Passcode Required
Passcode Required
Permission Denied
Permission Denied