Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

keitaropy-0.1.1-py3-none-any.whl (10.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page