Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 818 Bytes

README.md

File metadata and controls

45 lines (32 loc) · 818 Bytes

@_dotlas/api

npm node-current GitHub last commit

A simple client for the Dotlas REST API.

Installation

npm

npm i @_dotlas/api

yarn

yarn add @_dotlas/api

Usage

import { Client } from "@_dotlas/api"

// Create a client with your API key
const client = Client("<your-api-key>")

// Create a fetcher for the specific endpoint
const fetcher = client
  .path("/socio-demographics/stats/{city}")
  .method("get")
  .create()

// Call the fetcher
fetcher({ city: "New York" })
  .then(res => res.json())
  .then(res => {
    console.log(res.data)
  })