# keitaro
keitaro is a simple and easy to use API wrapper library for [Keitaro](https://keitaro.io/) Admin API written in Python3 and [aiohttp](https://pypi.org/project/aiohttp/)
## 📄 Official Keitaro resources
- [Keitaro Website](https://keitaro.io/)
- [Admin API documentation](https://admin-api.docs.keitaro.io/)
- [Technical Support](https://t.me/keitarobot)
## 📖 Getting Started
### Installation
Pypi package is not updated, you can build it using setup.py
### Keitaro tracker initialization
Begin by importing Keitaro class from aiokeitaro module and passing Admin API key and URL of Keitaro tracker to it
```python
from aiokeitaro import Keitaro
api = Keitaro('API KEY', 'URL with http or https (if is domain)')
```
## 📚 Examples
If API request was successful, status code 200 will be received and a response in the json format.
```python
import asyncio
from aiokeitaro import Keitaro, Offer
async def main():
api = Keitaro('API KEY', 'URL with http or https (if is domain)')
# Create an instance of the Offer class
offer = Offer(api)
# Call the get method on the instance
ss = await offer.get()
print(ss)
# run main.py
asyncio.run(main())
```
<details>
<summary>
<i>Click to see a response sample</i>
<a href="https://admin-api.docs.keitaro.io/#tag/Affiliate-Networks/paths/~1affiliate_networks~1{id}/delete">
Admin API reference</a>
</summary>
<p>
{
"id": 14,
"name": "string",
"postback_url": "string",
"offer_param": "string",
"state": "string",
"template_name": "string",
"notes": "string",
"pull_api_options": "string",
"created_at": "string",
"updated_at": "string",
"offers": "string"
}
</p>
</details>
### Get all offers or specific one
To get all offers call get() method without any arguments
```python
all_offers = await offer.get()
```
Let's try to get a specific offer by its id
```python
dummy_offer = await offer.get(21)
```
As a result you'll get a response in JSON format
<details>
<summary>
<i>Click to see a response sample</i>
</summary>
<p>
[
{
"id": 21,
"name": "string",
"group_id": 0,
"action_type": "string",
"action_payload": "string",
"action_options": [],
"affiliate_network_id": 0,
"payout_value": 0,
"payout_currency": "string",
"payout_type": "string",
"state": "string",
"created_at": {},
"updated_at": {},
"payout_auto": true,
"payout_upsell": true,
"country": [],
"notes": "string",
"affiliate_network": "string",
"archive": "string",
"local_path": "string",
"preview_path": "string"
}
]
</p>
</details>
### Campaign creation
To create an advertising campaign, you can simply call create() method of the campaigns resource
```python
payload = {
'name': 'Dummy campaign',
'state': 'disabled',
'cost_type': 'CPC',
'cost_value': '5',
'cost_currency': 'USD',
'cost_auto': True
}
campaign = await campaigns.create(payload)
```
The non-asynchronous module is located here: https://github.com/ysomad/keitaro
Raw data
{
"_id": null,
"home_page": "https://github.com/developerreva/aiokeitaro",
"name": "aiokeitaro",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "python python3 api-client aiohttp api-wrapper keitaro keitaro-tracker keitaro-async",
"author": "Developereva",
"author_email": "developereva@protonmail.com",
"download_url": "https://files.pythonhosted.org/packages/ce/b4/c42e5b57070e501f21ba8075d4551342ae47213a9e1940aeeda4001e1650/aiokeitaro-1.0.3.tar.gz",
"platform": null,
"description": "# keitaro\r\n\r\nkeitaro is a simple and easy to use API wrapper library for [Keitaro](https://keitaro.io/) Admin API written in Python3 and [aiohttp](https://pypi.org/project/aiohttp/)\r\n\r\n## \ud83d\udcc4 Official Keitaro resources\r\n\r\n- [Keitaro Website](https://keitaro.io/)\r\n- [Admin API documentation](https://admin-api.docs.keitaro.io/)\r\n- [Technical Support](https://t.me/keitarobot)\r\n\r\n## \ud83d\udcd6 Getting Started\r\n\r\n### Installation\r\n\r\nPypi package is not updated, you can build it using setup.py\r\n\r\n### Keitaro tracker initialization\r\n\r\nBegin by importing Keitaro class from aiokeitaro module and passing Admin API key and URL of Keitaro tracker to it\r\n\r\n```python\r\nfrom aiokeitaro import Keitaro\r\n\r\napi = Keitaro('API KEY', 'URL with http or https (if is domain)')\r\n```\r\n\r\n## \ud83d\udcda Examples\r\n\r\nIf API request was successful, status code 200 will be received and a response in the json format.\r\n\r\n```python\r\nimport asyncio\r\nfrom aiokeitaro import Keitaro, Offer\r\n\r\nasync def main():\r\n api = Keitaro('API KEY', 'URL with http or https (if is domain)')\r\n \r\n # Create an instance of the Offer class\r\n offer = Offer(api)\r\n \r\n # Call the get method on the instance\r\n ss = await offer.get()\r\n print(ss)\r\n\r\n# run main.py\r\nasyncio.run(main())\r\n\r\n```\r\n\r\n<details>\r\n <summary>\r\n <i>Click to see a response sample</i>\r\n <a href=\"https://admin-api.docs.keitaro.io/#tag/Affiliate-Networks/paths/~1affiliate_networks~1{id}/delete\">\r\n Admin API reference</a>\r\n </summary>\r\n <p>\r\n {\r\n \"id\": 14,\r\n \"name\": \"string\",\r\n \"postback_url\": \"string\",\r\n \"offer_param\": \"string\",\r\n \"state\": \"string\",\r\n \"template_name\": \"string\",\r\n \"notes\": \"string\",\r\n \"pull_api_options\": \"string\",\r\n \"created_at\": \"string\",\r\n \"updated_at\": \"string\",\r\n \"offers\": \"string\"\r\n }\r\n </p>\r\n</details>\r\n\r\n### Get all offers or specific one\r\n\r\nTo get all offers call get() method without any arguments\r\n\r\n```python\r\nall_offers = await offer.get()\r\n```\r\n\r\nLet's try to get a specific offer by its id\r\n\r\n```python\r\ndummy_offer = await offer.get(21)\r\n```\r\n\r\nAs a result you'll get a response in JSON format\r\n\r\n<details>\r\n <summary>\r\n <i>Click to see a response sample</i>\r\n </summary>\r\n <p>\r\n [\r\n {\r\n \"id\": 21,\r\n \"name\": \"string\",\r\n \"group_id\": 0,\r\n \"action_type\": \"string\",\r\n \"action_payload\": \"string\",\r\n \"action_options\": [],\r\n \"affiliate_network_id\": 0,\r\n \"payout_value\": 0,\r\n \"payout_currency\": \"string\",\r\n \"payout_type\": \"string\",\r\n \"state\": \"string\",\r\n \"created_at\": {},\r\n \"updated_at\": {},\r\n \"payout_auto\": true,\r\n \"payout_upsell\": true,\r\n \"country\": [],\r\n \"notes\": \"string\",\r\n \"affiliate_network\": \"string\",\r\n \"archive\": \"string\",\r\n \"local_path\": \"string\",\r\n \"preview_path\": \"string\"\r\n }\r\n ]\r\n </p>\r\n</details>\r\n\r\n### Campaign creation\r\n\r\nTo create an advertising campaign, you can simply call create() method of the campaigns resource\r\n\r\n```python\r\npayload = {\r\n 'name': 'Dummy campaign',\r\n 'state': 'disabled',\r\n 'cost_type': 'CPC',\r\n 'cost_value': '5',\r\n 'cost_currency': 'USD',\r\n 'cost_auto': True\r\n}\r\n\r\ncampaign = await campaigns.create(payload)\r\n```\r\n\r\nThe non-asynchronous module is located here: https://github.com/ysomad/keitaro\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Unofficial Asynchronous Keitaro Admin API client",
"version": "1.0.3",
"project_urls": {
"Documentation": "https://github.com/developerreva/aiokeitaro#-getting-started",
"Homepage": "https://github.com/developerreva/aiokeitaro",
"Keitaro Admin API Documentation": "https://admin-api.docs.keitaro.io/",
"Source Code": "https://github.com/developerreva/aiokeitaro"
},
"split_keywords": [
"python",
"python3",
"api-client",
"aiohttp",
"api-wrapper",
"keitaro",
"keitaro-tracker",
"keitaro-async"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3b401f6f312aa6bf406261b2194fbd7f3579ec625fedf8a54007ff2b2d848eca",
"md5": "8c954dd52ecc8e36983b9943a0cc7c15",
"sha256": "85da07ee30de7551c1f41d364596a8cf0f5e024c5c972bdb2ddb07e6413546d5"
},
"downloads": -1,
"filename": "aiokeitaro-1.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8c954dd52ecc8e36983b9943a0cc7c15",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 14657,
"upload_time": "2024-06-14T09:17:45",
"upload_time_iso_8601": "2024-06-14T09:17:45.663933Z",
"url": "https://files.pythonhosted.org/packages/3b/40/1f6f312aa6bf406261b2194fbd7f3579ec625fedf8a54007ff2b2d848eca/aiokeitaro-1.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ceb4c42e5b57070e501f21ba8075d4551342ae47213a9e1940aeeda4001e1650",
"md5": "996dbc08246c0d895dc4f20141cb0c20",
"sha256": "b80cd2708f3950ec32c3f029e3a655a61317b3b2dbb10af1f9a0c5a081841895"
},
"downloads": -1,
"filename": "aiokeitaro-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "996dbc08246c0d895dc4f20141cb0c20",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 10974,
"upload_time": "2024-06-14T09:17:47",
"upload_time_iso_8601": "2024-06-14T09:17:47.154350Z",
"url": "https://files.pythonhosted.org/packages/ce/b4/c42e5b57070e501f21ba8075d4551342ae47213a9e1940aeeda4001e1650/aiokeitaro-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-14 09:17:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "developerreva",
"github_project": "aiokeitaro",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "aiokeitaro"
}