How to import API Inventory from HAR file using Astra-cli
Last updated: August 18, 2025
Overview
This guide explains how to populate API inventory from HAR files using Astra-Cli.
Prerequisites
You need to have Astra Traffic Collector running with astra-cli
📄 How to Setup Astra Proxy Service Integration using astra-cli
How to use Astra-cli to populate API Inventory from HAR file
Now the Astra Traffic Collector is running in your laptop, it's time to run Astra-cli with HAR files and populate the API Inventory
1. How to capture HAR files in web browser
Follow this simple guide to understand how to save HAR file for different browser.
2. How to run Astra-cli with HAR file
For Mac & Linux:
chmod +x astra-cli
./astra-cli parser -t har -f yourHarFile.har -e astra.envFor Windows:
./astra-cli.exe parser -t har -f yourHarFile.har -e astra.env3. That's it!!! You will now be able to see API endpoints present in your HAR file in Astra dashboard
Run the following command and confirm the whether tracing was done successfully.
./astra-cli collector logs --since=15mTroubleshooting
I can't see API endpoint in my dashboard
Symptoms
I have configured the astra-traffic-collector. I don't see any API endpoint entry in my inventory even after successfully running the astra-cli with HAR file.
Causes
Requests in HAR file have status code other than 2XX or 3XX.
Solution
Astra Cli generates the trace only for the 2XX and 3XX response code.
Domain is not registered under ALLOWED_HOSTS
Misconfigured
astra.envfileKindly ensure that SENSOR_ID, ALLOWED_HOSTS, COLLECTOR_ID, CLIENT_ID, CLIENT_SECRET are set in
astra.envfile. You can run following command to validate theastra.envfile
./astra-cli validate -e astra.envFAQ
1. How to inspect logs of Astra Traffic Collector