Skip to main content

Easy access to windsor.ai Facebook APIs

Project description

FacebookAdsWindsorApi

FacebookAdsWindsorApi is a python package makes it easy to get marketing data from Facebook into python.

Windsor.ai allows to get marketing data from any platform. It simplifies the complexity of dealing with multiple platforms, unlocking unified, valuable information in a format that matters to you. For more details checkout onboard.windsor.ai.

Features

✅ Easy access to marketing data via windsor.ai APIs

✅ Lightweight (single dependency - requests)

✅ Supports both python 2.7+ and 3

Other Supported marketing and platforms

✅ Google Analytics

✅ Google Ads

✅ Facebook Ads

✅ Facebook organic

✅ Bing Ads

✅ Linkedin Ads

✅ Hubspot

✅ Salesforce

✅ Google search console

✅ Criteo

✅ Snapchat

✅ Tiktok

✅ Appnexus

✅ Campaign Manager

✅ Twitter

✅ Awin

✅ Adroll

✅ Shopify

✅ Klaviyo

✅ Airtable

✅ Intercom

✅ Zoho

✅ Idealo

✅ Pinterest

✅ Appsflyer

✅ Adobe

Usage

Installation

pip install FacebookAdsWindsorApi

Registration

You need to get a free API key to access windsor.ai's APIs. Register your account first and add a datasource like facebook ads and then get the API key. For more details check out our official API documentation and this article. Get the API key at https://onboard.windsor.ai

Minimal Example

from FacebookAdsWindsorApi.client import Client
from FacebookAdsWindsorApi.enums import LAST_7D
from FacebookAdsWindsorApi.enums import FIELD_SOURCE, FIELD_CAMPAIGN, FIELD_CLICKS

api_key = 'xxx'  # Get it from your windsor.ai account. It's recommended to store and get this securely, for example an env variable.

# Setup a client object with the API key
client = Client(api_key)

# Call the /connectors API.
campaign_clicks = client.connectors(date_preset=LAST_7D, fields=[FIELD_SOURCE, FIELD_CAMPAIGN, FIELD_CLICKS])

# can also be run like:
campaign_clicks = client.connectors(date_preset='last_7d', fields=['date','clicks','spend'])

# Response will be a python dict (parsed from the json response recieved).
print(campaign_clicks)

[
  {'date': '2021-04-15', 'clicks': 3, 'spend': 8.139999999999999},
  {'date': '2021-04-15', 'clicks': 2, 'spend': 6.51},
  {'date': '2021-04-15', 'clicks': 1, 'spend': 3.88},
  {'date': '2021-04-15', 'clicks': 4, 'spend': 3.275311},
  {'date': '2021-04-15', 'clicks': 6, 'spend': 1.408321}
  ],

# Get Google Ads data only
campaign_clicks = client.connectors(
    connector="google_ads",
    date_preset=LAST_7D,
    fields=["account_name", "campaign", "clicks", "datasource", "source", "spend"]
)

# Get Facebook Ads data only
campaign_clicks = client.connectors(
    connector="facebook",
    date_preset=LAST_7D,
    fields=["account_name", "campaign", "clicks", "datasource", "source", "spend"]
)

# Get list of all possible connectors (i.e: Google Ads, Facebook Ads, Twitter, Tik Tok etc.)
list_connectors = client.list_connectors
print(list_connectors)

['adform', 'adobe', 'adroll', 'all', 'amazon_ads', 'amazon_s3', 'amazon_sp', 'apple_search_ads', 'appnexus', 'appsflyer', 'awin', 'bing', 'cm360', 'criteo' 'currency_conversion', 'daisycon', 'dv360', 'facebook', 'facebook_leads', 'facebook_organic', 'gmailcsv', 'google_ad_manager', 'google_ads', 'google_pagespeed', 'googleanalytics', 'googleanalytics4', 'googlesheets', 'hubspot', 'idealo', 'instagram', 'klaviyo', 'linkedin', 'linkedin_organic', 'mailchimp', 'outbrain', 'pinterest', 'quora', 'reddit', 'rtbhouse', 'salesforce', 'searchconsole', 'sftp', 'shopify', 'snapchat', 'stripe', 'taboola', 'tiktok', 'twitter', 'twitter_organic', 'vertaa', 'zoho']

# Sample with date specific ranges.
dataset_with_ranges = client.connectors(
      date_from="2022-10-18",
      date_to="2022-10-20",
      fields=["account_name", "campaign", "clicks", "datasource", "source", "spend", "date"]
)

List of fields

The full list of fields that the package accepts is given in https://windsor.ai/connector/all/. Fields can be common to all the connectors or specific for each company.

Project details


Download files

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

Source Distribution

FacebookAdsWindsorApi-1.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

FacebookAdsWindsorApi-1.0.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file FacebookAdsWindsorApi-1.0.1.tar.gz.

File metadata

  • Download URL: FacebookAdsWindsorApi-1.0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for FacebookAdsWindsorApi-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f73499eade6368c4090e333ad3e18a5eb2cdffde3aa86dd9e0f8bae7640d4ca3
MD5 1a1ed93f6873793ae2edca560ff1eca6
BLAKE2b-256 29c97028204a910bb36704d7c446d4ba6ca815a86b681a35458865c77761638e

See more details on using hashes here.

File details

Details for the file FacebookAdsWindsorApi-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for FacebookAdsWindsorApi-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f84b23545428a6396a39ff4a67b2a88d0e140bf79f3b9b71494a681c9176a39d
MD5 e50f2c87e0ddeb4abee6676d1185e79f
BLAKE2b-256 2a9a822e7afbe1c8eb6b3e966f3a6a73b6f6278f7b00f54df36c98835ad2b3d9

See more details on using hashes here.

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