Skip to main content
@vepler/sdk is a typed client for every public endpoint, generated from the OpenAPI document. This page describes version 6.8.0.
Other package managers, runtimes and TypeScript settings are on Installation.

Create a client

The SDK sends the key in the x-api-key header. Create keys in the dashboard. Create one client and reuse it.

Call an endpoint

A method returns the parsed response body.
  • Names that are snake_case in the API are camelCase in the SDK: has_more becomes hasMore, total_count becomes totalCount and the geo_mode parameter becomes geoMode.
  • Some query parameters are typed as strings, including limit and offset on several GET endpoints such as getPropertiesByLocation: limit: "50". The request types show which.
  • The SDK sends X-API-Version: 2 with every request, so list endpoints that offer two formats return { object, url, data, has_more, total_count }, and the single-listing endpoints return the listing itself with "object": "listing". See Versions.

Methods

Methods are grouped by API area: address, airQuality, areas, avm, buildings, census, companies, connectivity, conservation, councils, energy, epc, floodRisk, geography, heritage, landConstraint, listings, metrics, planning, poi, property, prosperity, safety, schools, schoolsCatchment, search, sites, streets, system, titleDeeds and transactions. The package README lists every method. Some common ones:

Errors

Methods throw on any 4xx or 5xx response.
The class depends on the response body, so branch on statusCode. Every class is exported from @vepler/sdk/sdk/models/errors. The error bodies themselves are described on Errors.

Retries

The SDK does not retry unless you configure it. Set a policy for the client, and override it for a single call with retries:
  • Times are in milliseconds.
  • The SDK retries 429, 500, 502, 503 and 504 responses. Pass retryCodes with a call to change the list.
  • When a response has Retry-After, the SDK waits that long, up to maxInterval.
  • After maxElapsedTime it stops and throws the last error.
  • retryConnectionErrors: true also retries failed connections and timeouts. A request that timed out may still have completed and been charged, and a retry is charged again.
  • Without backoff, the defaults are initialInterval 500, maxInterval 60,000, exponent 1.5 and maxElapsedTime 3,600,000 (one hour).
A 429 from the daily credit cap does not clear until midnight UTC, so keep maxElapsedTime short.

Timeouts and cancellation

There is no timeout unless you set timeoutMs, on the client or on one call. A timeout throws RequestTimeoutError.
Aborting through signal throws RequestAbortedError. A call given a signal ignores timeoutMs.

Client options

Types

Request and response types are in @vepler/sdk/sdk/models/shared and @vepler/sdk/sdk/models/operations:
These subpaths need moduleResolution set to nodenext, node16 or bundler.

Standalone functions

Every method is also a function you can import on its own, so a bundler can leave out the rest of the SDK. These functions return a result object rather than throwing on API and network errors:

Versions

Each SDK release takes the number of the API release it was generated from: 6.8.0 matches API 6.8.0. The SDK is not republished for every API release, so later additions, such as the streets cursor starting_after, are not in 6.8.0. Pin an exact version, as Installation explains. See Versions.