External API docs

Quickstart

Make your first Openmart API call. Use this guide to create an API key, send a search request, and understand the next step in the business retrieval flow.

Prerequisites

Before you begin, make sure you have:

  • an Openmart account
  • an Openmart API key
  • a tool to send API requests, such as Postman or curl
1

Create an API key

To use the Openmart API, you'll first need an API key.

  1. Sign in to your Openmart account
  2. Go to the API management page
  3. Create a new API token
  4. Copy and save the key somewhere secure

You'll use this key to authenticate every API request.

Keep your API key private. Do not share it in client-side code or public repos.

2

Call the API

Use the search endpoint to find businesses.

Replace <your_api_key> with your own API token before sending the request. `query` is your main search input. `location` and `limit` are optional starter params you can safely tweak first.
cURL
<replace this> keys example values
curl -X POST "https://api.openmart.ai/api/v1/search" \
  -H "X-API-Key: <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "dentists in San Jose",
    "location": [{ "city": "San Jose", "state": "CA", "country": "US" }],
    "limit": 10
  }'
3

Inspect the response

JSON
{
  "results": [
    {
      "openmart_id": "om_12345",
      "name": "Bright Smile Dental",
      "website": "https://brightsmiledental.com",
      "city": "San Jose",
      "state": "CA",
      "category": "Dentist"
    }
  ]
}
4

Understand the retrieval flow

You asked Openmart to find businesses matching dentists in San Jose.

Openmart returned a list of matching businesses. Each business includes an openmart_id, which you can use later to fetch full business details. Openmart's current API docs already describe search and detail retrieval as a two-step flow using /api/v1/search or /api/v1/search/only_ids first, then /api/v1/business_records/list/openmart_id.

Required steps to handle asynchronous tasks

Understand how async tasks work, from task creation to status checks and result retrieval.

  1. 1

    Submit a task

    Start an async task and store the returned task ID.

    Open async enrichment endpoints
  2. 2

    Check batch status

    Poll the batch status endpoint until the task reaches a terminal state.

    Read check batch status
  3. 3

    Get task IDs in a batch

    Once the batch is ready, fetch task IDs so you can retrieve final results.

    Read get task IDs in a batch
  4. 4

    Get task results

    When the task is complete, call the results endpoint to fetch the final output.

    Read get task results

Next steps

You made your first API call.

Next, you can:

  • learn how search works in Search businesses
  • use openmart_id to fetch full business details
  • use /api/v1/search/only_ids if you only want IDs first
# Quickstart

Make your first Openmart API call.

## Prerequisites

- An Openmart account
- An Openmart API key
- A tool to send API requests, such as Postman or curl

## Step 1 – Create an API key

1. Sign in to your Openmart account
2. Go to the API management page
3. Create a new API token
4. Copy and save the key somewhere secure

Keep your API key private. Do not share it in client-side code or public repos.

## Step 2 – Call the API

```bash
curl -X POST "https://api.openmart.ai/api/v1/search" \
  -H "X-API-Key: <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "dentists in San Jose",
    "location": [{"city": "San Jose", "state": "CA", "country": "US"}],
    "limit": 10
  }'
```

## Step 3 – Inspect the response

```json
{
  "results": [
    {
      "openmart_id": "om_12345",
      "name": "Bright Smile Dental",
      "website": "https://brightsmiledental.com",
      "city": "San Jose",
      "state": "CA",
      "category": "Dentist"
    }
  ]
}
```

## Async workflow (for find_people, find_tech, lookup_business_email, lookup_people)

1. **Submit a task** → receive a `batch_id`
2. **Poll batch status** → GET /api/v1/task/batch/:batch_id/status until `batch_ready` is true
3. **Get task IDs** → GET /api/v1/task/batch/:batch_id/task_ids?status=COMPLETED
4. **Get task results** → GET /api/v1/task/:task_id