Simple and easy to use API wrapper library for Keitaro Admin API written in Python3 and requests
Project description
keitaropy
keitaropy is a simple and easy to use API wrapper library for Keitaro Admin API written in Python3 and requests
📖 Project links
📄 Official Keitaro resources
❔ Why should you use keitaropy
- allows to use multiple trackers in one solution
- no need knowledge of http requests
- incredibly easy to use
- follows the paradigm "write once, run everywhere"
📖 Getting Started
Installation
To install you need to have pip installed
pip install keitaropy
Keitaro tracker initialization
Begin by importing Keitaro class from keitaropy module and passing API key and URL to it
from keitaropy import Keitaro
api = Keitaro('Keitaro Admin API key', 'Keitaro tracker URL')
⚙ What can it do
All keitaropy functionality is presented in Google Sheet
📚 Examples
If request is successfully sent, a response will be received. You can see it simply by printing it in console
affnetwork = api.affnetworks.delete(14)
print(affnetwork)
Click to see a response sample Admin API reference
{ "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" }
Get all offers or specific one
To get all offers call get() method without any arguments
all_offers = api.offers.get()
Let's try to get a specific offer by its id
dummy_offer = api.offers.get(21)
As a result you'll get a response in JSON format
Click to see a response sample
[ { "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" } ]
Campaign creation
To create an advertising campaign, you can simply call create() method of the campaigns resource
payload = {
'name': 'Dummy campaign',
'state': 'disabled',
'cost_type': 'CPC',
'cost_value': '5',
'cost_currency': 'USD',
'cost_auto': True
}
campaign = api.campaigns.create(payload)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for keitaropy-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3877c1da5d4e99d9cdb7e23ce5d4953fd0abb07f6431d663a1e0a9c6c1e354e |
|
MD5 | feb163e7f3a69087888a7ec2a0211b26 |
|
BLAKE2b-256 | 45d86110239ca5ae1dcac6e108b580cfdbe27ec1dfb4bb05c2359559ae6eb980 |