You can connect an exchange via API safely if you configure the permissions correctly. An API allows your trading history to be transferred automatically to the PnL Flow trading journal without manually entering every trade.
The key rule is simple: use Read Only access whenever possible and never grant trading or withdrawal permissions unless they are absolutely required.
The most important principle is to give an application only the permissions it actually needs.
In this guide, we will explain what an exchange API is, which permissions are appropriate for a trading journal, and how to keep your API connection secure.
How to Connect an Exchange via API Safely
An API, or Application Programming Interface, allows one service to securely request specific information from another service.
For example, a trading journal can use an exchange API to retrieve:
- trade history;
- open and closed positions;
- entry and exit prices;
- trading fees;
- realized PnL;
- order information;
- trading pairs;
- opening and closing times.
This means traders do not need to manually copy every transaction into their journal.
Once the exchange is connected, this information can be used to calculate:
- profits and losses;
- win rate;
- Profit Factor;
- average winning trade;
- average losing trade;
- daily performance;
- performance by trading instrument;
- results across different strategies.
An API Key Is Not Your Exchange Password
This distinction is important.
When you create an API key, the exchange normally allows you to choose exactly which actions the connected service can perform.
Read Only
The service can retrieve information about your account and trading activity but cannot perform transactions.
Trading
The API can be given permission to create, modify, or cancel orders.
Withdraw
The API may be allowed to withdraw cryptocurrency from the account.
For a trading journal, Read Only access is normally sufficient.
Which API Permissions Are Safe to Use?
If the API connection is used exclusively for analytics and trade journaling, you should grant only the minimum permissions required.
Depending on the exchange, these permissions may be called:
- Read;
- Read Only;
- View;
- Account Information;
- Orders History;
- Trade History;
- Position History.
The exact names vary between exchanges.
The underlying principle remains the same:
A trading journal needs access to trading data. It does not need control over your funds.
Before you connect an exchange via API, always review the permissions assigned to the key.
Which Permissions Should You Avoid?
When creating an API key, carefully review every available permission.
If the connection is only being used for analytics, certain permissions are usually unnecessary.
Withdraw
This allows funds to be withdrawn from the exchange.
A trading journal does not need this permission.
Transfer
Some exchanges allow API keys to transfer assets between accounts or wallets.
If this functionality is not required, keep it disabled.
Trade
This permission allows an application to create, modify, or cancel orders.
For an automated trading journal, this functionality is normally unnecessary as well.
A safer setup looks like this:
Exchange → Read Only API → Trading Journal
The journal can receive your trading data without receiving control over your account.
Why Minimum API Permissions Matter
Cybersecurity uses a concept known as the Principle of Least Privilege.
It means that a service should receive only the permissions necessary to perform its intended function.
If a trading journal only needs your trade history, then the API key should only have permission to read that information.
Even if an API key were somehow compromised, limiting its permissions can significantly reduce the potential risk.
API Key and Secret Key
After creating an API connection, an exchange will usually provide two important credentials:
API Key — identifies the API connection.
Secret Key — a private credential used to authorize API requests.
The Secret Key should be protected carefully.
Many exchanges display it only once when the API key is created.
Avoid:
- sending your Secret Key through Telegram or other messengers;
- sharing it with other people;
- storing it in an unsecured text document;
- publishing screenshots of your API settings;
- entering API credentials on unknown websites;
- reusing the same API key across multiple services.
A better approach is to create a separate API key for every service you use.
For example:
PnL Flow Read Only
This makes it much easier to understand what each key is used for.
Use a Separate API Key for Each Service
Imagine that you use:
- a trading bot;
- an analytics platform;
- a trading journal.
Using one API key for all three services is not ideal.
Instead, create a separate key for each service.
For example:
Trading Bot API
Analytics API
PnL Flow API
This allows you to revoke access to one service without affecting the others.
If you stop using a particular platform, simply delete the API key that was created for it.
Restrict API Access by IP Address
Some exchanges allow you to specify which IP addresses are permitted to use an API key.
This is commonly known as an IP whitelist.
If a service supports this feature and provides fixed server IP addresses, IP restrictions can add another layer of security.
In that configuration, API requests are accepted only from approved servers.
Even if someone obtains the API credentials, they may be unable to use them from an unauthorized IP address.
The exact configuration depends on the exchange and the service you are connecting.
Enable Two-Factor Authentication
API security is only one part of protecting an exchange account.
You should also enable two-factor authentication (2FA) on the exchange itself.
An authenticator app is one of the most common methods.
Many exchanges also provide additional security features such as:
- anti-phishing codes;
- login confirmations;
- new-device notifications;
- withdrawal address whitelists;
- separate transaction passwords;
- API restrictions.
The stronger the security of the exchange account itself, the safer the overall setup will be.
Review Your API Keys Regularly
Over time, it is easy to forget which external services have access to your exchange account.
For this reason, periodically open the API Management section of your exchange.
Check:
- which API keys are currently active;
- which services they were created for;
- which permissions they have;
- when they were last used;
- whether you still need each connection.
If an API key is no longer required, delete it.
What to Do If Your API Key May Be Compromised
If you suspect that your Secret Key has been exposed, do not wait for suspicious activity to appear.
The safest approach is to:
- Log in to your exchange.
- Open the API Management section.
- Delete the compromised API key.
- Create a new API key.
- Enable only the minimum required permissions.
- Connect the new key to the service you use.
Once the old API key is deleted, it can no longer be used.
How API Connections Help Traders
One of the biggest advantages of using an API with a trading journal is automation.
Without an API, a trader may need to manually record:
- trade date;
- trading pair;
- position direction;
- entry price;
- exit price;
- position size;
- trade result;
- fees.
For active traders, manual journaling can quickly become time-consuming.
When you connect an exchange via API, trade data can be imported automatically into the journal.
Instead of spending time filling in spreadsheets, you can focus on analyzing your performance.
Which Trading Data Actually Matters?
Simply having a list of trades does not automatically make someone a better trader.
The real value of a trading journal appears when raw trading history is transformed into useful statistics.
For example, you can analyze:
- which days of the week are the most profitable;
- which trading pairs produce weaker results;
- your average profit per winning trade;
- your average loss;
- the win rate of a particular strategy;
- which trades generate most of your profits;
- when losing streaks tend to occur.
Over time, this information can help identify repeated mistakes and patterns in your trading behavior.
API vs. Manual Trade Import
Manual trade entry can work for traders who make only a few transactions per month.
However, active trading introduces several problems:
- trades can be forgotten;
- information can be entered incorrectly;
- fees may be missed;
- maintaining the journal takes time;
- statistics may become incomplete.
API integration helps automate this process.
At the same time, an analytics platform generally does not need full access to your exchange account.
Read Only access is enough for most trading journal integrations.
Safe Exchange API Connection Checklist
Before connecting an exchange API, use this checklist:
- enable two-factor authentication on your exchange account;
- create a separate API key for your trading journal;
- enable Read Only permissions;
- disable withdrawal permissions;
- disable transfer permissions;
- disable trading permissions unless specifically required;
- never publicly expose your Secret Key;
- delete old or unused API keys;
- use IP restrictions when supported.
The Most Important Rule
An API is not inherently dangerous.
Problems usually appear when an API key is given excessive permissions or when the Secret Key is stored insecurely.
For a trading journal, follow one simple principle:
Read trading data only — no trading, transfers, or withdrawals.
This allows you to automate trade tracking and performance analysis without giving the service unnecessary control over your account.
Before you connect an exchange via API, it is also a good idea to review the latest API requirements and permissions in the exchange’s official documentation.
PnL Flow — Analyze Your Trading Instead of Managing Spreadsheets
PnL Flow is designed to help traders systematically analyze their results.
Instead of simply looking at the final balance on an exchange, a trading journal allows you to analyze your trading history, PnL, profitable and losing periods, and other important performance metrics.
When connecting an exchange through API, always use the minimum permissions required and carefully review the access settings.
A good trading journal helps answer not only:
“How much did I make?”
but the much more important question:
“Why did I get this result?”

