Skip to content

Latest commit

 

History

History

custom_audience

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Custom Audience Generation

The script custom_audience_generator.py corresponds to our How to Build a Custom Audience with PDL Tutorial.

Getting Started

  1. Download the contents of this folder.
  2. Install Python 3.6+, requests, and pandas.
  3. Get a Free PDL License & API Key.
  4. Set your API key on line 12 of custom_audience_generator.py.
    'x-api-key': '**** YOUR API KEY HERE ****'
  5. Go to the custom_audience/ folder.
    $ cd ~/custom_audience
  6. Run the script. (NOTE: The script uses 25 Company Enrichment and 50 Person Search PDL credits!)
    $ python custom_audience_generator.py

Tips

For a detailed explanation of this script, please read the tutorial.

Getting Different Results

The tutorial was written using v19.0 of the PDL API.

In future builds, the companies or people matched may be different than the examples in the tutorial.

Minimizing Credit Usage

The script uses 25 Company Enrichment and 50 Person Search PDL credits.

Each time you run the script, it will use PDL credits. If you save the results of an API call and load them later (instead of making another request to PDL), it will not use credits.

To save the API results, you can export the pandas DataFrame to a CSV and load it in subsequent runs by commenting out the functions like this:

# first run, make the API call (costs PDL credits)
# ----
audience_df = get_decision_makers(companies)
audience_df.to_csv(csv_location / 'custom_audience.csv')
# audience_df = pd.read_csv(
#     csv_location / 'custom_audience.csv', header=0, index_col=0)
# future runs, do not make API call (no credits)
# ----
# audience_df = get_decision_makers(companies)
# audience_df.to_csv(csv_location / 'custom_audience.csv')
audience_df = pd.read_csv(
    csv_location / 'custom_audience.csv', header=0, index_col=0)