Skip to main content

awin-py

awin-py is a python wrapper around the AWIN API. The goals is to provide an easy to use interface for all AWIN API endpoints. It handles pagination, rate limiting, errors. Most information needed is available via docstrings, for further details please refer to the AWIN API docs.

>>> from advertiser_api.client import Awin
>>> Awin = Awin(client_id='***', client_secret='***')
>>> start_date = datetime.now() - timedelta(days=361)
>>> end_date = datetime.now()
>>> transactions = Awin.get_transactions(start_date=start_date, end_date=end_date)
>>> len(transactions)
1302
>>> transactions[0]
{"advertiserCost": {"amount": null, "currency": null},
 "advertiserCountry": "DE",
 "advertiserId": 11111,
 "amendReason": null,
 "amended": false,
 "basketProducts": null,
 "campaign": null,
 "clickDate": "2024-05-04T20:54:00",
 "clickDevice": "Android Mobile",
 "clickRefs": {"clickRef": "9184c7g4-9gbb-48g7-9e43-44717t5bed70"},
 "commissionAmount": {"amount": 4.26, "currency": "EUR"},
 "commissionSharingPublisherId": null,
 "commissionSharingSelectedRatePublisherId": null,
 "commissionStatus": "pending",
 "customParameters": [],
 "customerAcquisition": null,
 "customerCountry": "IE",
 "declineReason": null,
 "id": 1591984035,
 "ipHash": "-917875755098098",
 "lapseTime": 286,
 "networkFee": {"amount": 1.19, "currency": "EUR"},
 "oldCommissionAmount": null,
 "oldSaleAmount": null,
 "orderRef": "99439999999",
 "originalSaleAmount": null,
 "paidToPublisher": false,
 "paymentId": 0,
 "publisherId": 426667,
 "publisherUrl": null,
 "saleAmount": {"amount": 42.56, "currency": "EUR"},
 "siteName": "http://www.payback.de",
 "trackedCurrencyAmount": null,
 "transactionDate": "2024-05-14T20:59:00",
 "transactionDevice": "Linux",
 "transactionParts": [{"advertiserCost": null,
                       "amount": 42.56,
                       "commissionAmount": 4.26,
                       "commissionGroupCode": "DEFAULT",
                       "commissionGroupId": 167797,
                       "commissionGroupName": "Default",
                       "trackedParts": [{"amount": 42.56,
                                         "code": "DEFAULT",
                                         "currency": "EUR"}]}],
 "transactionQueryId": 0,
 "type": "Commission group transaction",
 "url": "http://www.payback.de",
 "validationDate": null,
 "voucherCode": "TESTTEST100",
 "voucherCodeUsed": true}

If something appears to be broken, please have a look at the open issues and vote for an existing issue or create a new one, if you can't find an issue that describes your problem.

Features

  • Aims to cover all functions of the Awin API (work in progress)
  • Python function wrappers for all API endpoints as part of the Awin class
  • Support for type hints

API Functions

awin-py currently only implements a subset of all available API features. This section gives an overview over which API endpoints are accessible through awin-py.

Available

  • Advertiser API
    • GET accounts
    • GET publishers
    • GET transactions (list)
    • GET transactions (ID)
    • GET reports aggregated by publisher
    • GET reports aggregated by creative
    • GET reports aggregated by campaign

Not yet implemented

  • Publisher API
  • Transaction Validation API

License

Copyright 2024 Friedrich ten Hagen

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Metadata

Release files for awin-py 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for awin-py 0.0.3
File Size Uploaded Provenance
awin_py-0.0.3.tar.gz 9.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for awin-py 0.0.3
File Interpreter ABI Platform
awin_py-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 18.9 kB

Release files / awin_py-0.0.3.tar.gz

Download URL awin_py-0.0.3.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
786e4ef4193d09971bd6a1190835a32f7f09d5d2310c16c5034e2146495869ad
BLAKE2b-256 checksum
How to use checksums
66c9e068cd90f4ee1ce83c76c209763090dd5f880f8c65185af305f734c5577e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.6

Release files / awin_py-0.0.3-py3-none-any.whl

Download URL awin_py-0.0.3-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9f694d77fa8e6b7308380b4b26d30a8fbf1a2c46cfb675c90bfea7b448b355c
BLAKE2b-256 checksum
How to use checksums
a3f066c5079a31c127e634e50e04eafbd71eaa1cb5e6b1acb0248dede21b2bf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.6

Security for awin-py 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page