Skip to content

Instantly share code, notes, and snippets.

@varunon9
Created July 18, 2024 14:13
Show Gist options
  • Select an option

  • Save varunon9/6398706fb58b45a198cfc7479b9e6e77 to your computer and use it in GitHub Desktop.

Select an option

Save varunon9/6398706fb58b45a198cfc7479b9e6e77 to your computer and use it in GitHub Desktop.
Get all leads of an instant form using Meta marketing API. We at https://groweasy.ai use this approach to download all leads for our clients

Get all leads belonging to an instant form-

curl --location 'https://graph.facebook.com/v18.0/<FORM_ID>/leads?limit=500&access_token=<LONG_LIVED_ACESS_TOKEN>'
  1. Replace <FORM_ID> with form id, e.g. 1260551454918979
  2. Replace <LONG_LIVED_ACESS_TOKEN> with your access token

Sample Response

{
    "data": [
        {
            "created_time": "2024-07-18T13:42:25+0000",
            "id": "1298429028153341",
            "field_data": [
                {
                    "name": "question4",
                    "values": [
                        "Path plus"
                    ]
                },
                {
                    "name": "question5",
                    "values": [
                        "Nothing"
                    ]
                },
                {
                    "name": "question1",
                    "values": [
                        "Nikhil Bhardwaj"
                    ]
                },
                {
                    "name": "question2",
                    "values": [
                        "panditnXXXXXXXXXX@gmail.com"
                    ]
                },
                {
                    "name": "question3",
                    "values": [
                        "+9180592XXXXX"
                    ]
                }
            ]
        }
    ],
    "paging": {}
}

Docs: https://developers.facebook.com/docs/marketing-api/guides/lead-ads/retrieving/

@itskanereeves

Copy link
Copy Markdown

Great example of using the Facebook Graph API to retrieve Instant Form leads efficiently. For businesses looking to collect and manage real estate agent leads, platforms like US Agent Leads can provide access to targeted agent contact data, making it easier to connect with relevant real estate professionals and support lead generation efforts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment