leadfetcher / README.md
ShahzainHaider's picture
Upload folder using huggingface_hub
b70e97f verified

A newer version of the Gradio SDK is available: 5.15.0

Upgrade
metadata
title: leadfetcher
app_file: space.py
sdk: gradio
sdk_version: 5.6.0

Apollo - Leads Fetcher

Leads Fetcher is a Python-based tool that extracts contact information and company details using the Apollo API. The tool processes JSON input, retrieves and organizes data into a structured format, and exports it as an Excel file. It also includes a web interface powered by Gradio.

Features

  • Fetches leads data from the Apollo API.
  • Retrieves contact information (emails, phone numbers) and LinkedIn profiles.
  • Outputs the data as an Excel file for easy analysis.
  • Interactive Gradio-based web interface for user-friendly operation.

Requirements

  • Python 3.8 or higher

Install the dependencies using:

pip install -r requirements.txt

How to Run the Code

  1. Clone the Repository

  2. Run via Gradio Interface

    python space.py
    
    • The application will launch in your web browser, allowing you to input JSON data.

Input Format

The input must be a valid JSON object with the required fields for Apollo API queries. Example:

{
    "page": 1,
    "contact_email_status_v2": ["likely_to_engage", "verified"],
    "prospected_by_current_team": ["no"],
    "person_titles": ["ceo"],
    "person_locations": ["Pakistan"],
    "per_page": 25
}

You can get the input from Aollo website like this.

How to get JSON input

  1. Go to the Apollo filtered link (for example): Apollo Filtered Link

  2. Open Inspect Element in your browser and navigate to the Network tab.

  3. Click on the first "search" entry in the Name column.

  4. Click on "View Parsed" and copy the entire payload.


Leads Fetcher Demo

Output

  • Excel File: The output is saved in the output_files/ directory with a unique identifier.
  • CSV Preview: If using the Gradio interface, a preview of the data is displayed.

Explanation of Key Functions

  1. convert_json_to_files(payload)

    • Takes JSON input and fetches lead data from the Apollo API.
    • Processes paginated results and retrieves detailed information.
    • Organizes data into a Pandas DataFrame and exports it as an Excel file.
  2. get_mixed_people(payload)

    • Sends a POST request to the Apollo API to fetch lead details.
    • Handles pagination and extracts people data.
  3. get_person_contact(linkedin_url_list)

    • Retrieves contact information (email, phone) for a batch of LinkedIn profiles.
  4. Gradio Interface

    • Allows users to input JSON, preview the extracted data, and download the result in Excel format.

Notes

  • Ensure your Apollo API key is valid and authorized for the endpoints used.
  • Large JSON inputs may take longer to process due to API and data handling.
  • Only works on 150 leads a hit on free plan