You are currently viewing Getting started with the OpenCorporates API: A beginner’s guide

Getting started with the OpenCorporates API: A beginner’s guide

Have you ever needed to look up information about companies across different countries? Whether you’re in business, government, or research, the OpenCorporates API provides a powerful way to access data about millions of companies worldwide. In this guide, we’ll walk through everything you need to know to start using the API.

What is OpenCorporates?

OpenCorporates is the largest open database of company information in the world. Our API lets you programmatically access:

  • Basic company information (name, registration number, status)
  • Company filings and documents
  • Officer (director) information
  • Corporate relationships and networks
  • Industry classifications
  • And much more

Getting started

1. Get your API key

Before you can start making requests, you’ll need an API key:

  1. Visit OpenCorporates’ self-serve API page
  2. Choose your plan
  3. Create a new account
  4. Save your API token – you’ll need it for all requests

2. Understanding the basics

The API endpoint is api.opencorporates.com. All requests should use HTTPS, and your API token should be included as a query parameter. Here’s the basic structure:

https://api.opencorporates.com/v0.4/[endpoint]?api_token=YOUR_TOKEN_HERE

To make a request from this endpoint you can use:

  • Your internet browser directly.
  • An API platform like Postman (recommended).

3. Your first API request

Let’s start with something simple – looking up a company. Here’s how to find information about a specific company:

https://api.opencorporates.com/v0.4/companies/gb/00102498?api_token=YOUR_TOKEN_HERE

This URL breaks down as:

  • /v0.4 – API version
  • /companies – the endpoint
  • /gb – jurisdiction code (Great Britain in this case)
  • /00102498 – company number

The response will include:

  • Company name
  • Registration details
  • Current status
  • Registered address
  • Officers (directors)
  • Filing history

Common use cases and examples

1. Searching for companies

To search for companies by name:

https://api.opencorporates.com/v0.4/companies/search?q=tesla&api_token=YOUR_TOKEN_HERE

The search is designed to be flexible:

  • Words can be in any order (“Barclays Bank” matches “Bank Barclays”)
  • Additional words in company names are allowed
  • Case-insensitive
  • Includes matches in previous company names

You can refine your search with parameters like:

  • jurisdiction_code – limit to a specific country/region
  • inactive – include/exclude inactive companies
  • order – sort by various fields

2. Looking up company officers

Find information about company directors and officers:

https://api.opencorporates.com/v0.4/officers/search?q=john+smith&api_token=YOUR_TOKEN_HERE

3. Understanding corporate networks

Explore company relationships and corporate hierarchies:

https://api.opencorporates.com/v0.4/companies/gb/00102498/network?api_token=YOUR_TOKEN_HERE

Best practices

  1. Monitor your usage
    • Use the /account_status endpoint to track your API calls
    • Stay within daily and monthly limits
    • Consider upgrading your plan if you need more calls
  2. Error handling
    • Check HTTP status codes
    • 200: Success
    • 401: Authentication error
    • 403: Rate limit exceeded
    • 404: Company not found
  3. Performance tips
    • Use the sparse=true parameter when you don’t need full details
    • Cache responses when appropriate
    • Batch requests when possible

Working with the results

The API returns JSON by default. Here’s what a basic company response looks like:

{
  "api_version": "0.4",
  "results": {
    "company": {
      "name": "EXAMPLE COMPANY LTD",
      "company_number": "12345678",
      "jurisdiction_code": "gb",
      "incorporation_date": "2020-01-01",
      "company_type": "Private Limited Company",
      "current_status": "Active"
    }
  }
}

Common challenges and solutions

  1. Company not found
    • Double-check the jurisdiction code and company number
    • Try searching by name instead
    • Consider if the company might be registered in a different jurisdiction
  2. Rate limiting
    • Implement exponential backoff
    • Monitor your usage with /account_status
    • Consider caching frequently accessed data
  3. Data consistency
    • Company identifiers vary by jurisdiction
    • Some jurisdictions provide more data than others
    • Always check the opencorporates_url field for the authoritative web page

Next steps

Now that you understand the basics, you might want to:

  1. Explore the more advanced endpoints like industry_codes and corporate_groupings
  2. Build tools to monitor company changes using the events endpoint
  3. Integrate company data into your applications
  4. Use the filings endpoint to track company documents and changes

Resources and support

Remember, the OpenCorporates API is a powerful tool for accessing company data, but it’s important to use it responsibly and in accordance with the terms of service. Start with simple queries, test thoroughly, and gradually build up to more complex integrations.

For help with particular use cases, feel free to speak with us today.

For more information

Learn more about how OpenCorporates’ data can help you understand corporate structures and manage risk. Reach out for a demo or explore our services.

Leave a Reply