Close more deals with automated sales lead research.

Customer Intelligence API


The API lets you programmatically access StackLead's customer intelligence data. You can query the API by sending a lead's email address and receive data either via an emailed research report or a JSON webhook. The API is under active development and we're always available at for any questions or comments.

Researching a Lead

The API is accessed at and there is currently one endpoint, which accepts HTTP POST requests:


The only required parameter is email, which must equal the lead's email address.


You can authenticate your request using HTTP Basic Auth. Use your API key as the basic auth username. You do not need to provide a password. Alternatively, you can authenticate by providing the api_key parameter with your request.

Delivery Methods

You can specify how you would like to receive API responses via the delivery_method parameter.

If delivery method equals email, then the response will be delivered as a research report to the reply address configured at the email settings page. This is the default option if delivery_method is not provided.

If delivery method equals webhook, then the response will be POST-ed as a JSON object to the webhook URL configured at the API settings page. You can read more about webhooks on Wikipedia.

// Research report will be emailed to your reply address delivery_method=email

// JSON object will be POST-ed to your webhook URL delivery_method=webhook

Optional Parameters

There are two optional parameters you can specify in your request to the lead research endpoint:

  • created

    The UNIX timestamp when a user was created, specified in seconds since Epoch. We will only send you an email research report if the user was created less than 24 hours ago. This is particularly useful if you use a third party service like with StackLead since you may have many Identify calls throughout your application, but only want to receive a research report for new users.

    // Set the UNIX timestamp in seconds since Epoch created=1401825429

  • token

    When you make an API request with delivery_method set to webhook, we POST lead research data to your configured webhook url. In order to verify that the data is coming from StackLead, you can pass a unique token in your request and we will include it in our POST-ed response to your webhook URL when we finish researching the lead. If you don't specify a token in your request, we will generate one and return it in our response.

    // Set the token to be returned token=asdfas214

    // Token returned in API response { "message": "Research data will be POST-ed to" "data": { "token": "asdfas214", "callback": "" } }

  • webhook_url

    The URL to POST the StackLead data to. This overrides the value configured on the user account at the API settings page. Setting this parameter also forces delivery_method to be webhook.

    // Set the webhook_url to post StackLead data to. webhook_url=

Example Request

Here is an example request to research the fictional email

curl \
   -u n25a0hsaljba: \
   -d \
   -d delivery_method=webhook

Example Response

If the delivery method equals webhook, then the JSON response that is POST-ed to your webhook URL will have the following structure:

  "token": "lkyp7nyc2hzx",
  "data": {
    "score": 7,
    "person": {...},
    "company": {...},
    "domain": {...}

Here is the data component from the response to the example request for

  "person": {
    "email": "",
    "name": "Rebecca (Becca) Schroeder",
    "first_name": "Rebecca",
    "last_name": "Schroeder",
    "headline": "Sr. Sales Representative at Blue Ocean Tech.",
    "location": "Greater Denver Area",
    "job_title": "Sr. Sales Representative",
    "image_url": "",
    "experiences": [
        "title": "Sr. Sales Representative",
        "name": "Blue Ocean Technologies",
        "description": "Blue Ocean's cloud-based ad infrastructure increases conversion rates by embedding interactions inside video.",
        "duration": "(5 months)",
        "start": "October 2013",
        "end": "Present",
        "linkedin": {
          "url": ""
    "education": [
        "name": "UC San Diego",
        "degree": "BA",
        "major": "Sociology",
        "begin": "2004-01-01",
        "end": "2008-12-31",
        "details": "Activities: Volleyball"
    "age": 28,
    "linkedin": {
      "url": "",
      "username": "RebeccaSchroeder",
      "connections": 500
    "twitter": {
      "url": ""
      "username": "BeccaSchroe",
      "followers": 252
  "company": {
    "name": "Blue Ocean Technologies",
    "headline": "The ultimate interactive video ad service",
    "description": "Video Ad Infrastructure",
    "employees": 127,
    "industry": "Information Technology and Services",
    "category": "enterprise",
    "image_url": "",
    "website": "",
    "type": "Privately Held",
    "funding": "$19.4M",
    "tags": "techstars, techstars-boulder-2010",
    "linkedin": {
      "url": ""
    "crunchbase": {
      "url": ""
      "url": "",
      "username": "BlueOcean",
      "followers": 2459
  "domain": {
    "name": "",
    "personal": false,
    "disposable": false,
    "interesting": true,
    "description": "Get started for free with disruptive in-video advertising.",
    "alexa": {
        "global": {
           "change": "Down 786 versus the previous 3 months.",
           "rank": 9362
     "tools": [
        "Google Analytics",
        "Crazy Egg",
        "Right Media",
        "Google AdWords Conversion",
        "Perfect Audience"
  "emails": [
   "email_catchall": false

JavaScript Snippet

By including our JavaScript snippet on your website, you can send email addresses (and other lead info) directly to StackLead. Copy the snippet below just before the </body> tag on your site and replace the tag on your site and replace the client_key with the key on the settings page

Copy the snippet

<script type="text/javascript">StackLeadConfig = {client_key: 'client_abc123'};</script>
<script type="text/javascript" src=""></script>

Automatic mode

By default, the snippet will monitor any form fields on your webpage and make a call to the StackLead API once the user has entered their email address. The snippet looks for an sl-field attribute on a field and falls back to the standard name attribute. For example, a form with lead capture inputs

<input sl-field="first_name" name="customName">
<input name="email">
will generate the API call {"first_name": "Rebecca", "email": ""}.

If you'd prefer to call the JS API manually (e.g. if you have a custom form and want to handle the submit event), set the automatic flag to false in the config and call StackLead.capture() in your form submit code. Here's a complete example:

<script type="text/javascript">
StackLeadConfig = {client_key: 'client_abc123', automatic: false};
<script type="text/javascript" src=""></script>
<script type="text/javascript">
function formSubmitHandler() {
StackLead.capture({email: ''});

Optional Parameters

If you collect additional data about your leads such as company name or location, you can improve the accuracy of our research results by passing this data through the JS snippet. You can either pass them automatically by settings sl-field on the user inputs or as part of a manual StackLead.capture(). We support the following parameters:

nameThe lead's complete nameRebecca Schroeder
first_nameThe lead's first nameRebecca
last_nameThe lead's last nameSchroeder
locationThe lead's locationDenver, CO
linkedinThe lead's LinkedIn URL
twitterThe lead's Twitter URL
companyThe lead's company nameBlue Ocean Technologies
company_websiteThe lead's company website