Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dashroshan/clashapi
🛠️ Python package to update ip address of clash of clans and clash royale api keys with token fetching
https://github.com/dashroshan/clashapi
clash-of-clans clash-royale clashapi coc cr
Last synced: 2 months ago
JSON representation
🛠️ Python package to update ip address of clash of clans and clash royale api keys with token fetching
- Host: GitHub
- URL: https://github.com/dashroshan/clashapi
- Owner: dashroshan
- Created: 2021-11-24T20:58:28.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-08T13:29:04.000Z (almost 3 years ago)
- Last Synced: 2024-10-29T21:28:19.315Z (2 months ago)
- Topics: clash-of-clans, clash-royale, clashapi, coc, cr
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ClashAPI
Using your developer account's login email and password, update the IP address of all your existing Clash of Clans and/or Clash Royale API keys to the current one, and obtain their tokens.
## Getting Started
### Installing
```bash
pip install clashapi
```### Usage
```python
import clashapi# Clash of Clans
tokens = clashapi.coc("email", "password")# Clash Royale
tokens = clashapi.cr("email", "password")# tokens is a list of api key token strings that you can now use to access the COC/CR APIs
```### Quick Example
```python
import requests
import clashapi
tokens = clashapi.coc("email", "password")response = requests.get(url="https://api.clashofclans.com/v1/clans/%23208GJG2J", headers={"Accept": "application/json", "authorization": f"Bearer {tokens[0]}"})
print(response.json())
```