Docs · API reference

Search people

Start a search for people by job title, then ask for the results. Each person is checked against their live profile, so a search takes a few minutes. People come back with no email: use Find a work email for the ones you want.

Preview: may change before launch · Updated

Preview

This is how the API is planned to work. Names and fields may change before launch. The APIs are in early access: join early access to get a key when they're ready.

POST https://api.magpie-cloud.com/v1/people/searches. What it's for, and how it works: Prospect search API.

Request

A JSON body, with your API key in the Authorization header (see Authentication).

FieldTypeRequiredWhat it is
titlesstring[]Yes1 to 10 job titles to match, such as Head of Operations.
senioritiesstring[]NoAny of owner, founder, c_suite, partner, vp, head, director, manager, senior, entry, intern, worked out from each person's title.
countriesstring[]NoTwo-letter codes, such as GB.
citiesstring[]NoCities to search in.
industriesstring[]NoThe industries of the companies they work at.
headcountobjectNomin and max employees at their company.
companiesstring[]NoUp to 25 company names. Few people pass this filter.
limitintegerNoHow many people to look for, from 1 to 200. 25 if left out.

Example

Request · POST /people/searches
curl https://api.magpie-cloud.com/v1/people/searches \
  -H "Authorization: Bearer $MAGPIE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "titles": ["Head of Operations"],
    "seniorities": ["head", "director"],
    "industries": ["Truck Transportation"],
    "countries": ["GB"],
    "limit": 25
  }'
Response · 200
{
  "id": "ps_0baf089fe94eedd45f",
  "status": "running",
  "limit": 25,
  "poll_after_ms": 5000
}

Ask for the results until status is done. People arrive as they're confirmed, each with a name, title, seniority, company, country and profile link, and next pages through them with cursor. stats says how many candidates were looked at, so an empty search can be explained.

Response: GET /people/searches/{id}
{
  "id": "ps_0baf089fe94eedd45f",
  "status": "done",
  "found": 1,
  "people": [
    {
      "name": "Alex Sample",
      "title": "Head of Operations",
      "title_verified": true,
      "seniority": "head",
      "company": {
        "name": "Example Freight Ltd",
        "domain": "examplefreight.example",
        "industry": "Truck Transportation",
        "headcount": "51-200"
      },
      "country": "GB",
      "profile_url": "https://profiles.example/alex-sample"
    }
  ],
  "next": null,
  "stats": {
    "searches": 3,
    "candidates": 9,
    "verified": 1,
    "rejected": {
      "title mismatch": 8
    }
  },
  "credits_charged": 1
}

Response

FieldTypeWhat it is
idstringThe search's id, for asking for its results.
statusstringrunning.
poll_after_msintegerHow long to wait before asking for results, in milliseconds.

Errors

Errors come back as JSON with a code and a message. See Errors for the shape, and when to try again.

StatusCodeWhen
400invalid_requestA filter isn't valid, or titles is missing.
401unauthorizedThe API key is missing, wrong or revoked.
402out_of_creditsYour credits have run out.
403feature_unavailablePeople search isn't open to your account yet.
429poll_too_soonYou asked for results within 2 seconds of asking before.
429rate_limitedToo many requests. Wait the number of seconds in the Retry-After header, then try again.
5xxVariesSomething went wrong on our side. Safe to try again after a short wait.

Billing

The planned price is 1 credit (£0.004$0.006) for each person returned. It may change before launch. Starting a search is free, and a search that finds no one costs nothing.

See Credits and prices for how credits work.

Notes

  • POST /people/searches/{id}/more carries on the same search through its next cities, and DELETE /people/searches/{id} stops one. Nobody is charged twice.
  • An account can run one search at a time and start 20 a day. A search forgotten for an hour expires.
  • People who have opted out of prospecting are left out.
  • Nobody is kept on our side: what you store is up to you.

Questions about the APIs? Email pele@magpiecrm.com.