- Base URL:
https://address-suggestions-api.sls.epilot.io - Full API Docs: https://docs.epilot.io/api/address-suggestions
import { epilot } from '@epilot/sdk' epilot.authorize(() => '<token>') const { data } = await epilot.addressSuggestions.getAddresses(...)
import { getClient, authorize } from '@epilot/sdk/address-suggestions' const addressSuggestionsClient = getClient() authorize(addressSuggestionsClient, () => '<token>') const { data } = await addressSuggestionsClient.getAddresses(...)
Addresses API
Schemas
AvailabilityResultErrorAddressSuggestionAddressSuggestionsValidateAddressSuggestionsFileResultValidateAddressFileResultAddressSuggestionErrorValidateAddressFileError
Get address suggestions for the given file id
GET /v1/public/suggestions
const { data } = await client.getAddresses({ X-Epilot-Org-ID: 'example', s3FileUrl: 'example', fileId: 'example', countryCodeSearchTerm: 'example', postalCodeSearchTerm: 'example', streetSearchTerm: 'example', })
Response
[
{
"country": "string",
"postal_code": "string",
"city": "string",
"street": "string",
"street_number": "string"
}
]Check the availability of a given address within multiple files
GET /v1/public/availability:check
const { data } = await client.checkAvailability({ X-Epilot-Org-ID: 'example', files: 'example', countryCode: 'example', postalCode: 'example', street: 'example', streetNumber: 'example', })
Response
{
"fileId": "4e7b7d95-ced6-4f5f-9326-0c61f30dcadb"
}Validates an addresses file, it returns an array of errors if the file is invalid
GET /v1/addresses-files:validate
const { data } = await client.validateAddressesFile({ fileId: 'example', })
Response
{
"status": "success",
"rules_parsed_count": 0,
"errors": [
{
"line": 0,
"msg": "string",
"data": "string"
}
]
}type AvailabilityResult = { fileId?: string }
type Error = { message: string status?: number cause?: string }
The address suggestions entity
type AddressSuggestion = { country?: string postal_code?: string city?: string street?: string street_number?: string }
The address suggestions entity array
type AddressSuggestions = Array<{ country?: string postal_code?: string city?: string street?: string street_number?: string }>
The availability map file result payload
type ValidateAddressSuggestionsFileResult = { status?: "success" | "error" rules_parsed_count?: number errors?: Array<{ line?: number msg: string data?: string }> }
The address file validation result payload
type ValidateAddressFileResult = { status?: "success" | "error" rules_parsed_count?: number errors?: Array<{ line?: number msg: string data?: string }> }
The availability rule error
type AddressSuggestionError = { line?: number msg: string data?: string }
The address rule error
type ValidateAddressFileError = { line?: number msg: string data?: string }