Skip to content

markovianhq/nexusadspy

Repository files navigation

Nexusadspy

A thin Python wrapper on top of the Appnexus API.

Status

PyPI version Build Status [Build status] (https://ci.appveyor.com/project/waltherg/nexusadspy/branch/master) [codecov] (https://codecov.io/gh/markovianhq/nexusadspy) [Join the chat at https://gitter.im/markovianhq/Lobby] (https://gitter.im/markovianhq/Lobby) [Documentation Status] (https://nexusadspy.readthedocs.io/en/latest/?badge=latest)

Installation

$ pip install nexusadspy

Usage Example

Set your developer username and password in the environment:

$ export USERNAME_NEXUSADSPY='...'
$ export PASSWORD_NEXUSADSPY='...'

To query the API for a list of all our advertisers:

from nexusadspy import AppnexusClient
client = AppnexusClient('.appnexus_auth.json')
r = client.request('advertiser', 'GET')

To download data on just one of your advertisers, simply pass their ID in the request:

r = client.request('advertiser', 'GET', data={'id': 123456})

See the documentation for more examples.