A Python script for bulk-checking HTTP status codes from a list of URLs. The tool includes concurrency, retries, robust error handling, command-line interface (CLI), and structured CSV output.
- Multithreaded Requests: Uses
ThreadPoolExecutorfor fast, concurrent URL checking. - Automatic Retries: Handles transient errors (500–504) with a configurable retry strategy.
- Robust Error Handling: Detects and clearly reports timeouts, connection errors, invalid URLs, and HTTP errors.
- Custom Headers: Uses a friendly
User-Agentto reduce chances of getting blocked. - CSV Output: Saves results to
results.csvwith structured information (URL, status code, message). - Command-Line Interface:
- Accepts a
--file(or-f) argument to specify an input file. - Defaults to
urls.txtif no file is provided.
- Accepts a
| Filename | Usage |
|---|---|
| check.py | The main executable Python script |
| urls.txt | Input file containing the list of URLs to check (one per line) |
| results.csv | Output file containing structured status check results |
| README.md | This file |
| CHANGELOG | Full changelog of changes and improvements |
| LICENSE | Project license (MIT) |
| CONTRIBUTING | Guidelines for contributing to the project |
- Create or edit
urls.txtand include one URL per line. - Run the script using:
python3 check.py- (Optional) To use a custom input file:
python3 check.py -f myfile.txt- The results will be printed to the terminal and saved to
results.csv.
Console:
https://example.com @ 200 - Success
https://nonexistent.example @ 404 - HTTP Error: 404 Client Error: Not Found for url
results.csv:
URL,Status Code,Message
https://example.com,200,Success
https://nonexistent.example,404,HTTP Error: 404 Client Error: Not Found for url
Please see CHANGELOG for detailed update history.
If you discover any security-related issues, please get in touch with me via Twitter instead of using the public issue tracker.
The MIT License (MIT). Please see the License File for more information.