{"id":21937002,"url":"https://github.com/robertdevore/api-audit","last_synced_at":"2026-03-02T07:32:20.217Z","repository":{"id":261712570,"uuid":"885112113","full_name":"robertdevore/api-audit","owner":"robertdevore","description":"Python script that finds API URLs, grabs request headers \u0026 bodies, and outputs a full report","archived":false,"fork":false,"pushed_at":"2024-11-08T01:24:17.000Z","size":4,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-09T19:31:56.990Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertdevore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-08T01:20:30.000Z","updated_at":"2024-12-30T22:30:54.000Z","dependencies_parsed_at":"2024-11-08T10:19:19.373Z","dependency_job_id":null,"html_url":"https://github.com/robertdevore/api-audit","commit_stats":null,"previous_names":["robertdevore/api-audit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robertdevore/api-audit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdevore%2Fapi-audit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdevore%2Fapi-audit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdevore%2Fapi-audit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdevore%2Fapi-audit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertdevore","download_url":"https://codeload.github.com/robertdevore/api-audit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdevore%2Fapi-audit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29995006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T01:17:19.711Z","updated_at":"2026-03-02T07:32:20.212Z","avatar_url":"https://github.com/robertdevore.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API Audit\n\nThis script scans PHP files in a specified directory (and its sub-directories) to identify API URLs containing `://api.`. \n\nIt retrieves any associated request headers and body data, saving the results to a timestamped CSV file in a `reports`folder. \n\nThis tool helps developers and security analysts understand API interactions within their codebase.\n\n## Features\n\n- Scans all PHP files in the specified directory and subdirectories\n- Identifies and records API URLs containing `://api.`\n- Captures associated request headers and body data (if any)\n- Saves results to a timestamped CSV file in a `reports` folder\n- Provides a real-time progress bar and summary of results after completion\n\n## Requirements\n\n- Python 3.x\n- `tqdm` library for the progress bar (install with `pip install tqdm`)\n\n## Installation\n\n1. Clone or download this repository to your local machine.\n2. Ensure Python 3.x is installed on your system.\n3. Install the `tqdm` library for the progress bar by running:\n    ```\n    pip install tqdm\n    ```\n\n## Usage\n\n1. **Run the Script**\n\nOpen a terminal, navigate to the directory containing the script, and execute:\n    ```\n    python3 apiAudit.py\n    ```\n\n2. **Progress Bar and Output**\n\n    - While the script runs, a progress bar will display the number of PHP files scanned, giving you real-time feedback on the process.\n    - Once complete, a summary will appear, indicating:\n        - Total files scanned\n        - PHP files with API URLs found\n        - Unique API URLs identified\n        - Execution time\n3. **CSV Report**\n\n    - Results are saved in a CSV file in the `reports` folder.\n    - The filename is timestamped for easy identification, e.g., `api_urls_with_headers_and_body_20241107_201000.csv`.\n    - The CSV includes the following columns:\n        - **File Path**: Path of the PHP file containing the API URL\n        - **API URL**: The complete API URL\n        - **Request Headers**: Captured headers associated with the API call\n        - **Request Body**: Captured body data associated with the API call\n\n## Example Output\n\nAfter scanning, the summary might look like this:\n```\n    --- Scan Summary ---\n    Total files scanned: 120\n    Total PHP files with API URLs found: 15\n    Total unique API URLs identified: 25\n    Time taken: 10.25 seconds\n    Data successfully saved to reports/api_urls_with_headers_and_body_20241107_201000.csv\n```\n\n## Troubleshooting\n\n- **Encoding Errors**: Certain files may cause encoding errors, which are automatically suppressed to prevent script interruption.\n- **Slow Performance**: For large directories, the scan may take longer. The progress bar will help you track progress in real time.\n\n## License\n\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdevore%2Fapi-audit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertdevore%2Fapi-audit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdevore%2Fapi-audit/lists"}