Docs · API reference

Search companies

Search for companies by industry, headcount and country, and get back each one's name, domain, industry and size. To look up one company, use GET /companies/lookup with its domain, name or url.

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/companies/search. What it's for, and how it works: Company search API.

Request

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

FieldTypeRequiredWhat it is
industriesstring[]NoIndustry names, from GET /reference/industries. Give this or headcount.
headcountobjectNomin and max employees. Give this or industries.
countriesstring[]NoTwo-letter codes, such as GB, from GET /reference/countries.
limitintegerNoCompanies a page, from 1 to 100. 25 if left out.
cursorstringNoThe next value from the page before. Leave it out for the first page.

Example

Request · POST /companies/search
curl https://api.magpie-cloud.com/v1/companies/search \
  -H "Authorization: Bearer $MAGPIE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "industries": ["Truck Transportation"],
    "headcount": { "min": 50, "max": 500 },
    "countries": ["GB"],
    "limit": 25
  }'
Response · 200
{
  "companies": [
    {
      "name": "Example Freight Ltd",
      "domain": "examplefreight.example",
      "company_url": "https://profiles.example/company/example-freight",
      "industry": "Truck Transportation",
      "headcount": "51-200",
      "employees": 140,
      "hq": "Leeds",
      "country": "GB"
    }
  ],
  "next": "cur_25",
  "total": 240,
  "coverage": "full"
}

Response

FieldTypeWhat it is
companies[].namestringThe company's name.
companies[].domainstring or nullIts website domain.
companies[].company_urlstring or nullIts public company page.
companies[].industrystring or nullIts industry.
companies[].headcountstring or nullIts headcount band, such as 51-200.
companies[].employeesinteger or nullIts exact headcount, when known.
companies[].hqstring or nullWhere its head office is.
companies[].countrystring or nullTwo-letter code.
nextstring or nullSend it back as cursor for the next page; null on the last page.
totalintegerHow many companies match.
coveragestringfull, or partial when we hold few companies for this filter and are finding more.

Errors

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

StatusCodeWhen
400invalid_requestNeither industries nor headcount was given, or a filter isn't valid.
401unauthorizedThe API key is missing, wrong or revoked.
402out_of_creditsYour credits have run out.
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 company returned. It may change before launch.

See Credits and prices for how credits work.

Notes

  • There's no keyword search: the filters above are what we can search by.
  • The country filter goes by what a company's page says about its head office, so it's close rather than exact.
  • Companies come back without people or emails.

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