Autocomplete
Autocomplete companies
Auto complete the name search
Request Body
application/json
Requiredname
RequiredAuto completion inputBeginning of the name or the domain of a company
countryFilters
array<unknown> | null | nullexcludeDomains
array<unknown> | null | nullQuery Parameters
apiToken
string | null | nullHeader Parameters
x-api-token
string | null | nullResponse Body
Successful Response
TypeScript Definitions
Use the response body type in TypeScript.
companies
RequiredCompanies foundArray of found companies. Returns empty array if no results
Bad Request
TypeScript Definitions
Use the response body type in TypeScript.
detail
RequiredstringValue in:
"Conflicting API tokens provided in query parameters and headers"
Payment Required
TypeScript Definitions
Use the response body type in TypeScript.
detail
RequiredstringValue in:
"Insufficient credits"
Forbidden
TypeScript Definitions
Use the response body type in TypeScript.
detail
RequiredstringValue 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.
detail
Detailcurl -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"
}
]
}