<a href="https://github.com/cxdzc/TornAPIWrapper">
  <img src="https://github.com/cxdzc/TornAPIWrapper/assets/110936008/271aa9c8-280e-4fd9-be9e-cd8b88d53329" alt="Banner">
</a>

<div align="center">
<a href="https://pypi.org/project/TornAPIWrapper/"><img src=https://img.shields.io/pypi/v/tornapiwrapper?cacheSeconds=300></a>
<a href="https://pypi.org/project/TornAPIWrapper/"><img src=https://img.shields.io/pypi/pyversions/tornapiwrapper?cacheSeconds=300></a>
<a href="https://pypi.org/project/TornAPIWrapper/"><img src=https://img.shields.io/pepy/dt/tornapiwrapper?color=blue&cacheSeconds=300></a>
<a href="https://www.torn.com/api.html#:~:text=Patch%20Notes"><img src=https://img.shields.io/badge/patch-19.02.2026-c4c4c4?cacheSeconds=300></a>
<a rel="license" href="https://github.com/cxdzc/TornAPIWrapper/blob/main/LICENSE"><img alt="MIT License" src="https://img.shields.io/badge/license-MIT-ab1436"/></a>
</div>

# 🌃 TornAPIWrapper
A Python wrapper for the [Torn City API v2](https://www.torn.com/swagger.php), providing access to [Torn City](https://www.torn.com) data.

### ✨ Features
* Sync and async support.
* Built-in API error handling.
* Modern, Pythonic API wrapper.


# 💾 Instructions
1. Install the [TornAPIWrapper](https://pypi.org/project/TornAPIWrapper) package by typing `pip install tornapiwrapper` in your terminal.
2. Check out [examples](https://github.com/cxdzc/TornAPIWrapper/tree/main/Examples) and [documentations](https://github.com/cxdzc/TornAPIWrapper?tab=readme-ov-file#-documentations) to familiarize yourself with the API.
3. Create an [API key](https://www.torn.com/preferences.php#tab=api).
4. Start programming!

# 📑 Documentations
There are two Torn City API documentations that I recommend reading to understand how the Torn API and TornAPIWrapper work.

- **[Official Torn API Docs v2:](https://www.torn.com/swagger.php)** Used by this project - best for endpoints, parameters, response schemas, and searching what to call and request.
- **[Official Torn API Docs v1:](https://www.torn.com/api.html)** Useful reference - explains API keys, access levels, limits, error codes, and ToS details not covered in v2.

# 💝 Contributors
<a href="https://github.com/cxdzc/TornAPIWrapper/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=cxdzc/TornAPIWrapper" />
</a>
<br><br>

View [CONTRIBUTING.md](https://github.com/cxdzc/TornAPIWrapper?tab=contributing-ov-file) to contribute.

# 📜 License
> [!NOTE]
> This is not legal advice.

The content and software in this repository are licensed under the [MIT License](https://github.com/cxdzc/TornAPIWrapper?tab=MIT-1-ov-file), a simple and permissive license that allows use, modification, and distribution as long as the license notice is preserved.