Autocomplete

Autocomplete companies

Auto complete the name search

POST
/v2/autocomplete/companies

Request Body

application/jsonRequired
nameRequiredAuto completion input

Beginning of the name or the domain of a company

countryFiltersarray<unknown> | null | null
excludeDomainsarray<unknown> | null | null

Query Parameters

apiTokenstring | null | null

Header Parameters

x-api-tokenstring | null | null

Response Body

Successful Response

TypeScript Definitions

Use the response body type in TypeScript.

companiesRequiredCompanies found

Array of found companies. Returns empty array if no results

Bad Request

TypeScript Definitions

Use the response body type in TypeScript.

detailRequiredstring
Value in: "Conflicting API tokens provided in query parameters and headers"

Payment Required

TypeScript Definitions

Use the response body type in TypeScript.

detailRequiredstring
Value in: "Insufficient credits"

Forbidden

TypeScript Definitions

Use the response body type in TypeScript.

detailRequiredstring
Value in: "API token should be provided in headers or query parameters" | "Current API token is not registered in our database"

Not found

Validation Error

TypeScript Definitions

Use the response body type in TypeScript.

detailDetail
curl -X POST "https://api.ocean.io/v2/autocomplete/companies?apiToken=string" \
  -H "x-api-token: string" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ocea",
    "countryFilters": [
      "dk",
      "se"
    ],
    "excludeDomains": [
      "ocean.com"
    ]
  }'
const body = JSON.stringify({
  "name": "ocea",
  "countryFilters": [
    "dk",
    "se"
  ],
  "excludeDomains": [
    "ocean.com"
  ]
})

fetch("https://api.ocean.io/v2/autocomplete/companies?apiToken=string", {
  headers: {
    "x-api-token": "string"
  },
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://api.ocean.io/v2/autocomplete/companies?apiToken=string"
  body := strings.NewReader(`{
    "name": "ocea",
    "countryFilters": [
      "dk",
      "se"
    ],
    "excludeDomains": [
      "ocean.com"
    ]
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("x-api-token", "string")
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.ocean.io/v2/autocomplete/companies?apiToken=string"
body = {
  "name": "ocea",
  "countryFilters": [
    "dk",
    "se"
  ],
  "excludeDomains": [
    "ocean.com"
  ]
}
response = requests.request("POST", url, json = body, headers = {
  "x-api-token": "string",
  "Content-Type": "application/json"
})

print(response.text)
{
  "companies": [
    {
      "domain": "ocean.io",
      "logo": "https://cdn2.ocean.io/companies-logos-v1/domain.com/020539e284d9318e805301b672ad23047c30818a.png",
      "name": "Ocean"
    }
  ]
}
{
  "detail": "Conflicting API tokens provided in query parameters and headers"
}
{
  "detail": "Insufficient credits"
}
{
  "detail": "API token should be provided in headers or query parameters"
}
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}