PyAhmia uses Ahmia.fi to search for hidden services on the Tor network
that match with a specified query, without an explicit requirement for Tor.
Features
- Search Ahmia.fi from the command line
- Export results to CSV
- Enable/Disable routing requests through Tor
- Return results in a clean readable format
- Response caching for faster repeated searches
- Configurable result limits and request timeout
Installation
PyAhmia is available on PyPI and can be installed like so:
pip install pyahmia
This will install ahmia and pyahmia as commands.
Usage
To start searching, you can call ahmia (or pyahmia) with the specified search query.
example:
ahmia QUERY
Routing Traffic Through Tor (Optional)
PyAhmia works without Tor, but you can enable routing traffic through Tor if you want.
When this is enabled, it will use Ahmia's darknet url instead of the clearnet variant.
To enable routing through Tor, you can call ahmia with the -t, --use-tor flag.
This assumes the tor service is running in the background, otherwise, the command will fail before you can say "hidden
wiki".
If Tor is not installed, you can check out the installation scripts located in pyahmia/scripts.
example:
ahmia QUERY --use-tor
Exporting Output
PyAhmia only supports exporting data to csv files (for now), and in order to export, you'll need to specify the
-e, --export flag.
This will export your search results to a file named after your search query.
example:
ahmia QUERY --export
Filtering Results by Time Period
Results can be filtered by 3 time periods (day, week, month). By default, results will be taken from all time periods (
all). You can change this by using the -p, --period option, and pass the time period you want to get results from.
example:
ahmia QUERY --period week
Limiting Results
By default, PyAhmia displays up to 100 results. You can change this with the -l, --limit option.
example:
ahmia QUERY --limit 50
To show all results regardless of the limit, use the -a, --all flag.
example:
ahmia QUERY --all
Caching
PyAhmia caches responses by default to reduce redundant requests. To disable caching, use the --no-cache flag.
example:
ahmia QUERY --no-cache
Request Timeout
You can set a custom timeout (in seconds) for requests using the --timeout option. The default is 10 seconds.
example:
ahmia QUERY --timeout 30
In Conclusion
Don't send too many requests with pyahmia. Be nice to the owners of Ahmia.fi :)
Contributing
Contributions are welcome! If you’d like to improve PyAhmia, fix a bug, or add a feature:
- Fork the repository
- Create a new branch for your changes
- Commit and push your changes
- Open a pull request
Please keep PRs focused and provide a clear description of the problem being solved. Bug reports and feature requests are also appreciated, just open an issue.
License
This project is licensed under the MIT License, see the LICENSE file for details.
Metadata
Release files for pyahmia 0.11.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyahmia-0.11.4.tar.gz | 11.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyahmia-0.11.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.6 kB
Release files / pyahmia-0.11.4.tar.gz
| Download URL | pyahmia-0.11.4.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d7e56ea7fdf1035ae1d0e20e9d45179b94e75595f3698522f836dd82be67260
|
|
BLAKE2b-256 checksum How to use checksums |
61f726149ac058a35bde65e9c59e84400a808378261010f464cf47b1b027d790
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.
Transparency logRelease files / pyahmia-0.11.4-py3-none-any.whl
| Download URL | pyahmia-0.11.4-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a25a387b3c8c0bf5a171079bf89e038ef1452f00e0e04d389c211a867f4339b
|
|
BLAKE2b-256 checksum How to use checksums |
5a83939785c9f9f03b0704eab9fa0af847fa8f3a0c7cf4098613decc199c168c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.
Transparency log