Skip to main content
1

Description

Credit UsageUp to 10 Company Search API Credits and 100 Person Search API Credits will be used to execute this recipe
This recipes guides you through how to export a list of 100 leads with a current engineering role and a director level position from computer software companies with an employee size greater than 1,000.
2

Initial Setup

If using the Python SDK, import the SDK library and initiate the client object. Otherwise, specify the Company Search and Person Search API endpoints.Locate and copy your API Key from the API Dashboard
3

Set API Key

If using the Python SDK, we place our API key for authentication in the client class constructor.Otherwise, we place our API key for authentication in the header fields of our request. Alternatively, we could have added the API Key into the input parameters.
4

Set Company Search Elastic Query

We set the query so that it will pull computer software companies with more than 1,000 employees.
5

Set Company Search Input Parameters

We set input parameters by assigning the query that we built in the previous step and by limiting the response to 10 records.
6

Send Company Search Request

We execute our company search query and assign its result to a response object.
7

Check If Company Search Query Was Successful

We check the status code of the response. If we receive a successful response (200), we then perform our person search query.
8

Iterate Through Each Company

We iterate through the list of companies we collected to find employees within each of them.
9

Set Person Search Query

We set the query so that it will pull directors with an engineering role from the company that we’re currently iterating through.
10

Limit the Number of Responses

We limit the response to 10 records per company by setting the size parameter to 10
11

Send Person Search Request

We execute our person search query and assign its result to a response object.
12

Save Person Data

If the response is successful, we append the results of our query to an array of them.
13

Check for Errors in the Person Search Query

If the person search query was not successful, we output why it was not.
14

Check for Errors in the Company Search Query

If the company search query was not successful, we output why it was not.
15

Output Results to a CSV File

Define a function that outputs the list of leads to a CSV file.
16

Set variables to pass to the function

Define the headers, file name to pass to the save_profiles_to_csv() function
17

Execute the function

Call the save_profiles_to_csv() function and pass the variables you set in the previous step.
18

Congratulations!

Success!You successfully generated a CSV containing engineers with a director level in companies in the computer software industry with an employee size greater than 1,000 employees!