@vepler/sdk is a typed client for every public endpoint, generated from the OpenAPI document. This page describes version 6.8.0.
Create a client
x-api-key header. Create keys in the dashboard. Create one client and reuse it.
Call an endpoint
- Names that are snake_case in the API are camelCase in the SDK:
has_morebecomeshasMore,total_countbecomestotalCountand thegeo_modeparameter becomesgeoMode. - Some query parameters are typed as strings, including
limitandoffseton several GET endpoints such asgetPropertiesByLocation:limit: "50". The request types show which. - The SDK sends
X-API-Version: 2with 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 withretries:
- Times are in milliseconds.
- The SDK retries 429, 500, 502, 503 and 504 responses. Pass
retryCodeswith a call to change the list. - When a response has
Retry-After, the SDK waits that long, up tomaxInterval. - After
maxElapsedTimeit stops and throws the last error. retryConnectionErrors: truealso 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 areinitialInterval500,maxInterval60,000,exponent1.5 andmaxElapsedTime3,600,000 (one hour).
maxElapsedTime short.
Timeouts and cancellation
There is no timeout unless you settimeoutMs, on the client or on one call. A timeout throws RequestTimeoutError.
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:
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 cursorstarting_after, are not in 6.8.0. Pin an exact version, as Installation explains. See Versions.