API mapper
- Command-Line Interface (CLI) Integration: Use the
argparse
library to handle CLI arguments. - Recursive Crawling: Continue to recursively crawl API endpoints.
- Output Handling: Save results and provides user feedback through CLI.
-
Command-Line Arguments:
--url
: The base URL to start crawling from.--timesec
: The delay between requests (default is 0.5 seconds).--depth
: The maximum depth for crawling (default is 3).--output
: The file to save the results (default isscraped_data.json
).
-
Recursive Crawling: The script recursively explores routes up to a specified depth.
-
Error Handling: Handles JSON parsing errors and HTTP request failures.
-
Output: Saves the collected data in a JSON file and prints a confirmation message.
To run this script, you would use a command like:
git clone https://github.com/DeadmanXXXII/APImapi.git
pip install -r requirements.txt
python3 apimapi.py --url https://techcrunch.com/wp-json/tc/v1/ --timesec 1 --depth 3 --output api_map.json