Mantra
Fast JavaScript endpoint extractor — discovers API endpoints and URLs from JavaScript files
Recon & OSINT4 commands
#js#endpoint#extract#golang
Installation
1Install using Go
2Verify installation
# Using Go
go install github.com/MrEmpy/mantra@latest
# Verify
mantra versionBasic Usage
Extract endpoints, URLs, and paths from JavaScript files
# Extract from a single JS file
mantra -u https://example.com/script.js
# Extract from multiple URLs
mantra -u https://example.com/app.js https://example.com/bundle.js
# Save output to file
mantra -u https://example.com/script.js -o endpoints.txt
# Verbose output
mantra -u https://example.com/script.js -vCommand Reference
4 commands
1URL of the JavaScript file to analyze
-u2Output file for extracted endpoints
-o3Verbose output
-v4Show help message
--helpWhen to Use
1
Extracting hidden API endpoints from JS bundles2
Mapping client-side application routes3
Recon phase of bug bounty hunting4
Analyzing SPAs for undiscovered endpointsNotes & Tips
1
Focused specifically on endpoint extraction from JS files2
Useful for finding API routes hardcoded in client-side code3
Works well when combined with gau or waybackurls for JS discoveryCommon Errors & Solutions
No endpoints found
Check if the JS file is accessible and not blocked by WAF
Connection timeout
Use a VPN or proxy if the target is geo-restricted