dataandapis 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/README.md +467 -2
- package/dist/index.cjs +421 -0
- package/dist/index.d.cts +19538 -0
- package/dist/index.d.ts +19538 -0
- package/dist/index.js +411 -0
- package/package.json +70 -4
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Data and APIs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,468 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dataandapis
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Official JavaScript and TypeScript client for [Data and APIs](https://dataandapis.com/?ref=npm): 128 REST data APIs behind one API key. VAT validation, barcode lookup, IP intelligence, sanctions screening, company data, holidays, currency rates, geocoding and more.
|
|
4
|
+
|
|
5
|
+
- One client, one key, every API: `client.vat`, `client.barcodeLookup`, `client.ipIntelligence` and 125 others
|
|
6
|
+
- Typed parameters and responses, with autocomplete for every endpoint
|
|
7
|
+
- Works with `import` and `require`, in TypeScript and plain JavaScript
|
|
8
|
+
- No dependencies
|
|
9
|
+
- Timeouts, automatic retries and typed errors built in
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install dataandapis
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add dataandapis
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
yarn add dataandapis
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
bun add dataandapis
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Get an API key
|
|
30
|
+
|
|
31
|
+
Create a free account at [dataandapis.com/sign-up](https://dataandapis.com/sign-up?ref=npm) and generate a key on the dashboard. The Free plan includes 500 tokens a month and needs no card. Most calls cost 1 token.
|
|
32
|
+
|
|
33
|
+
## Quick start
|
|
34
|
+
|
|
35
|
+
ES modules and TypeScript:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { DataAndApis } from "dataandapis";
|
|
39
|
+
|
|
40
|
+
const client = new DataAndApis({ apiKey: process.env.DATAANDAPIS_API_KEY });
|
|
41
|
+
|
|
42
|
+
const check = await client.vat.validateVatNumber({ vat: "IE6388047V" });
|
|
43
|
+
console.log(check.valid, check.name); // true "GOOGLE IRELAND LIMITED"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
CommonJS:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
const { DataAndApis } = require("dataandapis");
|
|
50
|
+
|
|
51
|
+
const client = new DataAndApis({ apiKey: process.env.DATAANDAPIS_API_KEY });
|
|
52
|
+
|
|
53
|
+
client.vat.validateVatNumber({ vat: "IE6388047V" }).then((check) => {
|
|
54
|
+
console.log(check.valid, check.name);
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
If you leave `apiKey` out, the client reads the `DATAANDAPIS_API_KEY` environment variable.
|
|
59
|
+
|
|
60
|
+
## Examples
|
|
61
|
+
|
|
62
|
+
Look up a product by barcode:
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
const product = await client.barcodeLookup.lookupByBarcode({ barcode: "3017620422003" });
|
|
66
|
+
console.log(product.name, product.brand); // "Nutella" ...
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Check an IP address:
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
const ip = await client.ipIntelligence.lookupIp({ address: "8.8.8.8" });
|
|
73
|
+
console.log(ip.country, ip.asn.organization, ip.is_datacenter); // "US" "GOOGLE" false
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Screen a name against sanctions lists:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
const result = await client.sanctions.screenName({ name: "Viktor Bout", min_score: 0.85 });
|
|
80
|
+
if (result.hit) console.log(result.matches[0].matched_name, result.matches[0].score);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Send a JSON body with `body` (POST endpoints):
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
const batch = await client.sanctions.screenNamesBatch({
|
|
87
|
+
body: { names: ["Osama bin Laden", "Viktor Bout", "Acme Trading LLC"] },
|
|
88
|
+
});
|
|
89
|
+
console.log(batch.hits);
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Convert a currency amount:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
const fx = await client.currencyRates.convert({ from: "USD", to: "GBP", amount: 100 });
|
|
96
|
+
console.log(fx.result);
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Endpoints that return a file give you a [`Blob`](https://developer.mozilla.org/docs/Web/API/Blob):
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
import { writeFile } from "node:fs/promises";
|
|
103
|
+
|
|
104
|
+
const png = await client.qrCodeGenerator.generateQrCode({ data: "https://dataandapis.com", size: 400 });
|
|
105
|
+
await writeFile("qr.png", Buffer.from(await png.arrayBuffer()));
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## How it is organised
|
|
109
|
+
|
|
110
|
+
Every API in the [catalog](https://dataandapis.com/apis?ref=npm) is a property of the client, and every endpoint is a method on it. Each method takes the endpoint's path and query parameters as one object, plus `body` for POST endpoints, and returns the parsed response.
|
|
111
|
+
|
|
112
|
+
Your editor shows the available methods, their parameters with an example value, the token cost and a link to the endpoint's documentation page. The [full list of APIs](#apis) is at the end of this page.
|
|
113
|
+
|
|
114
|
+
## Options
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
const client = new DataAndApis({
|
|
118
|
+
apiKey: "...", // default: process.env.DATAANDAPIS_API_KEY
|
|
119
|
+
timeout: 30_000, // milliseconds per attempt, default 30000
|
|
120
|
+
maxRetries: 2, // retries for GET requests, default 2
|
|
121
|
+
headers: {}, // extra headers for every request
|
|
122
|
+
fetch: customFetch, // a fetch implementation to use instead of the global one
|
|
123
|
+
onResponse: (info) => console.log(info.api, info.status, info.tokensRemaining),
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Every method takes per-call options as its second argument:
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
const controller = new AbortController();
|
|
131
|
+
|
|
132
|
+
await client.vat.validateVatNumber(
|
|
133
|
+
{ vat: "FR40303265045" },
|
|
134
|
+
{ timeout: 45_000, maxRetries: 0, signal: controller.signal },
|
|
135
|
+
);
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
| Option | Meaning |
|
|
139
|
+
|---|---|
|
|
140
|
+
| `timeout` | Milliseconds to wait for this call |
|
|
141
|
+
| `maxRetries` | Retries for this call |
|
|
142
|
+
| `signal` | An `AbortSignal` that cancels the call |
|
|
143
|
+
| `headers` | Extra headers for this call |
|
|
144
|
+
| `query` | Extra query parameters, for parameters newer than your version of the SDK |
|
|
145
|
+
|
|
146
|
+
### Retries
|
|
147
|
+
|
|
148
|
+
GET requests are retried after a network error or a 408, 502, 503 or 504 response, with a growing pause between attempts. POST requests are never retried. Failed calls do not use tokens.
|
|
149
|
+
|
|
150
|
+
### Token balance
|
|
151
|
+
|
|
152
|
+
The APIs report how many tokens are left on your key with each response. `onResponse` receives it:
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
const client = new DataAndApis({
|
|
156
|
+
onResponse: ({ tokensRemaining }) => {
|
|
157
|
+
if (tokensRemaining !== undefined && tokensRemaining < 50) console.warn("Running low on tokens");
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Errors
|
|
163
|
+
|
|
164
|
+
Every failure is an instance of `DataAndApisError`.
|
|
165
|
+
|
|
166
|
+
| Class | When | Useful fields |
|
|
167
|
+
|---|---|---|
|
|
168
|
+
| `AuthenticationError` | 401: the key is missing or not valid | `status`, `body` |
|
|
169
|
+
| `PaymentRequiredError` | 402: the subscription is past due | `paymentUrl` |
|
|
170
|
+
| `QuotaExceededError` | 429: the monthly token allowance is used up | `tokensRemaining` |
|
|
171
|
+
| `ApiError` | Any other status outside 200 to 299, such as 400 or 404 | `status`, `body`, `api`, `url` |
|
|
172
|
+
| `TimeoutError` | No response within the timeout | `cause` |
|
|
173
|
+
| `ConnectionError` | The request never got a response | `cause` |
|
|
174
|
+
|
|
175
|
+
The three classes for 401, 402 and 429 extend `ApiError`.
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
import { ApiError, DataAndApis, QuotaExceededError } from "dataandapis";
|
|
179
|
+
|
|
180
|
+
try {
|
|
181
|
+
await client.barcodeLookup.lookupByBarcode({ barcode: "0000000000000" });
|
|
182
|
+
} catch (err) {
|
|
183
|
+
if (err instanceof QuotaExceededError) {
|
|
184
|
+
// upgrade the plan or wait for the monthly reset
|
|
185
|
+
} else if (err instanceof ApiError && err.status === 404) {
|
|
186
|
+
console.log("Not in the catalogue:", err.message);
|
|
187
|
+
} else {
|
|
188
|
+
throw err;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
A call cancelled through your own `AbortSignal` rejects with the signal's abort error, not a `DataAndApisError`.
|
|
194
|
+
|
|
195
|
+
## TypeScript
|
|
196
|
+
|
|
197
|
+
Types ship with the package. Nothing else to install.
|
|
198
|
+
|
|
199
|
+
Response types are inferred from one sample response per endpoint, so treat them as a guide: a field can be `null` or missing for other inputs. To use your own type, pass it as a type argument:
|
|
200
|
+
|
|
201
|
+
```ts
|
|
202
|
+
interface Holiday {
|
|
203
|
+
date: string;
|
|
204
|
+
name: string;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const next = await client.publicHolidays.nextHolidays<{ holidays: Holiday[] }>({ country: "MX" });
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Every parameter and response type is exported, named after the API and the method:
|
|
211
|
+
|
|
212
|
+
```ts
|
|
213
|
+
import type { VatValidateVatNumberParams, VatValidateVatNumberResponse } from "dataandapis";
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Calling an endpoint that is not in the SDK yet
|
|
217
|
+
|
|
218
|
+
`client.request()` calls any path with the same key, retries and errors:
|
|
219
|
+
|
|
220
|
+
```ts
|
|
221
|
+
const data = await client.request("vat", "/v1/vat/validate", { query: { vat: "IE6388047V" } });
|
|
222
|
+
|
|
223
|
+
const posted = await client.request("sanctions", "/v1/screen", {
|
|
224
|
+
method: "POST",
|
|
225
|
+
body: { names: ["Acme Trading LLC"] },
|
|
226
|
+
});
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
The first argument is the API's slug from its catalog URL, or its name on the client.
|
|
230
|
+
|
|
231
|
+
## Requirements
|
|
232
|
+
|
|
233
|
+
A runtime with a global `fetch`: Node.js 18 or later, Bun, Deno or Cloudflare Workers.
|
|
234
|
+
|
|
235
|
+
Call the APIs from your server. They do not send CORS headers, so requests from a web page are blocked by the browser, and a key in front-end code would be visible to every visitor.
|
|
236
|
+
|
|
237
|
+
## APIs
|
|
238
|
+
|
|
239
|
+
<!-- apis:start -->
|
|
240
|
+
### AI
|
|
241
|
+
|
|
242
|
+
| API | On the client | What it does |
|
|
243
|
+
|---|---|---|
|
|
244
|
+
| [Image to Text API](https://dataandapis.com/apis/image-to-text?ref=npm) | `client.imageToText` | Describe any image, answer questions about it or read its text with an on-platform vision model |
|
|
245
|
+
| [Object Detection API](https://dataandapis.com/apis/object-detection?ref=npm) | `client.objectDetection` | Labels, confidence scores and bounding boxes for the objects in any image, with an on-platform model |
|
|
246
|
+
| [Sentiment Analysis API](https://dataandapis.com/apis/sentiment-analysis?ref=npm) | `client.sentimentAnalysis` | Positive or negative with a confidence score for any text, from a model that runs on the platform |
|
|
247
|
+
| [Text Embeddings API](https://dataandapis.com/apis/text-embeddings?ref=npm) | `client.textEmbeddings` | 768-dimensional text embeddings for semantic search, clustering and RAG, from an on-platform model |
|
|
248
|
+
|
|
249
|
+
### Business
|
|
250
|
+
|
|
251
|
+
| API | On the client | What it does |
|
|
252
|
+
|---|---|---|
|
|
253
|
+
| [Business Patterns API](https://dataandapis.com/apis/business-patterns?ref=npm) | `client.businessPatterns` | Establishments, employment and payroll for every US county, state and ZIP by NAICS industry, Census 2023 |
|
|
254
|
+
| [Federal Contracts API](https://dataandapis.com/apis/federal-contracts?ref=npm) | `client.federalContracts` | 86,500 active SAM.gov opportunities and 48,000 awards over $1M, searchable and refreshed daily |
|
|
255
|
+
| [Federal Grants API](https://dataandapis.com/apis/grants?ref=npm) | `client.grants` | All 83,000 Grants.gov funding opportunities since 2003 with forecasts, searchable by status and agency |
|
|
256
|
+
| [Occupations API](https://dataandapis.com/apis/occupations?ref=npm) | `client.occupations` | O*NET occupations with 56,495 alternate job titles for normalising any job title to a SOC code |
|
|
257
|
+
| [Salary Benchmarks API](https://dataandapis.com/apis/salary-benchmarks?ref=npm) | `client.salaryBenchmarks` | BLS wage benchmarks for every US occupation by state and metro: mean, median and percentiles |
|
|
258
|
+
| [Tariff Codes API](https://dataandapis.com/apis/tariff-codes?ref=npm) | `client.tariffCodes` | All 35,804 lines of the US Harmonized Tariff Schedule with duty rates, searchable |
|
|
259
|
+
|
|
260
|
+
### Data
|
|
261
|
+
|
|
262
|
+
| API | On the client | What it does |
|
|
263
|
+
|---|---|---|
|
|
264
|
+
| [Air Quality API](https://dataandapis.com/apis/air-quality?ref=npm) | `client.airQuality` | Nearest-station PM2.5, ozone and US AQI readings for any coordinates |
|
|
265
|
+
| [Aircraft API](https://dataandapis.com/apis/aircraft?ref=npm) | `client.aircraft` | 7,259 ICAO aircraft type designators with class, engines, wake category and FAA dimensions for 1,744 types |
|
|
266
|
+
| [Airports API](https://dataandapis.com/apis/airports?ref=npm) | `client.airports` | 85,944 airports, heliports and airfields worldwide by IATA or ICAO code, with runways and frequencies |
|
|
267
|
+
| [Animals API](https://dataandapis.com/apis/animals?ref=npm) | `client.animals` | 2,800 animal species with taxonomy, diet, lifespan, speed, habitat, prey, predators and IUCN status |
|
|
268
|
+
| [Astronomy API](https://dataandapis.com/apis/astronomy?ref=npm) | `client.astronomy` | Sunrise, sunset, twilight, golden hour, moon phase and moonrise for any coordinates and date, computed in-worker |
|
|
269
|
+
| [Baby Names API](https://dataandapis.com/apis/baby-names?ref=npm) | `client.babyNames` | Popularity, gender split and year-by-year trends for every US baby name since 1880 |
|
|
270
|
+
| [Cars API](https://dataandapis.com/apis/cars?ref=npm) | `client.cars` | EPA fuel economy and specs for 50,000 US vehicles since 1984: MPG, CO2, EV range and annual fuel cost |
|
|
271
|
+
| [Cats API](https://dataandapis.com/apis/cats?ref=npm) | `client.cats` | 67 cat breeds with origin, temperament, lifespan, weight and 1-to-5 trait scores, with images |
|
|
272
|
+
| [Climate Normals API](https://dataandapis.com/apis/climate-normals?ref=npm) | `client.climateNormals` | NOAA 1991-2020 climate normals for 15,616 US stations: typical highs, lows, rain, snow and degree days by month |
|
|
273
|
+
| [Company Enrichment API](https://dataandapis.com/apis/companies?ref=npm) | `client.companies` | Turn a domain or work email into company name, industry, size, HQ, tickers and socials |
|
|
274
|
+
| [Continents, Countries And Cities API](https://dataandapis.com/apis/continents-countries-and-cities?ref=npm) | `client.continentsCountriesAndCities` | 252 countries, 7 continents and 235,640 cities from GeoNames with coordinates, population, timezone and names |
|
|
275
|
+
| [Country Flags API](https://dataandapis.com/apis/country-flags?ref=npm) | `client.countryFlags` | ISO 3166 codes, localized country names, flag emoji and SVG flag URLs for every country |
|
|
276
|
+
| [Country Indicators API](https://dataandapis.com/apis/country-indicators?ref=npm) | `client.countryIndicators` | 24 World Bank development indicators for 217 countries since 1960: GDP, life expectancy, internet use and more |
|
|
277
|
+
| [Demographics API](https://dataandapis.com/apis/demographics?ref=npm) | `client.demographics` | 32 Census ACS metrics for every US ZIP, county, metro, city and state: income, age, education, housing |
|
|
278
|
+
| [Dictionary API](https://dataandapis.com/apis/dictionary?ref=npm) | `client.dictionary` | Definitions and examples for 155,000 English words, grouped by part of speech, from WordNet 3.1 |
|
|
279
|
+
| [Dogs API](https://dataandapis.com/apis/dogs?ref=npm) | `client.dogs` | 296 AKC-recognised dog breeds with 14 scored traits, size, coat, colours, history and popularity since 2015 |
|
|
280
|
+
| [Earthquakes API](https://dataandapis.com/apis/earthquakes?ref=npm) | `client.earthquakes` | 311,590 earthquakes of magnitude 4.5 and above since 1900 from USGS, with nearby and largest lookups, daily |
|
|
281
|
+
| [Emission Factors API](https://dataandapis.com/apis/emission-factors?ref=npm) | `client.emissionFactors` | 13,000 DEFRA and EPA greenhouse-gas emission factors with gases, units and the published file they came from |
|
|
282
|
+
| [EV Chargers API](https://dataandapis.com/apis/ev-chargers?ref=npm) | `client.evChargers` | 105,000 EV charging stations in the US and Canada with connectors, power, networks and hours, synced daily |
|
|
283
|
+
| [Federal Register API](https://dataandapis.com/apis/federal-register?ref=npm) | `client.federalRegister` | Search every Federal Register rule, proposed rule, notice and executive order by keyword, agency and date |
|
|
284
|
+
| [Geocoding API](https://dataandapis.com/apis/geocoding?ref=npm) | `client.geocoding` | Place names to coordinates and back for 235,640 cities and towns worldwide, no third-party calls |
|
|
285
|
+
| [Hospitals API](https://dataandapis.com/apis/hospitals?ref=npm) | `client.hospitals` | 5,419 Medicare-certified US hospitals with CMS star ratings, emergency services and coordinates |
|
|
286
|
+
| [Hurricanes API](https://dataandapis.com/apis/hurricanes?ref=npm) | `client.hurricanes` | Every Atlantic and Pacific tropical cyclone NOAA has tracked since 1851: 3,266 storms with six-hourly tracks |
|
|
287
|
+
| [IP Intelligence API](https://dataandapis.com/apis/ip-intelligence?ref=npm) | `client.ipIntelligence` | Country, ASN, datacenter, cloud and Tor detection with an explainable risk score for any IP |
|
|
288
|
+
| [Marine Buoys API](https://dataandapis.com/apis/buoys?ref=npm) | `client.buoys` | Live wave, wind and sea-temperature observations from 1,938 NOAA buoys and coastal stations worldwide |
|
|
289
|
+
| [Motorcycles API](https://dataandapis.com/apis/motorcycles?ref=npm) | `client.motorcycles` | Specs for 42,500 motorcycle models from 607 brands, 1894 to today, with full factory spec sheets and photos |
|
|
290
|
+
| [Nonprofits API](https://dataandapis.com/apis/nonprofits?ref=npm) | `client.nonprofits` | Verify any US nonprofit by EIN: IRS tax-exempt status and whether donations are deductible |
|
|
291
|
+
| [Population API](https://dataandapis.com/apis/population?ref=npm) | `client.population` | UN population estimates and projections for 237 countries, 1950 to 2100, with 20 demographic indicators |
|
|
292
|
+
| [Power Plants API](https://dataandapis.com/apis/power-plants?ref=npm) | `client.powerPlants` | 34,936 power plants in 167 countries with capacity, fuel, coordinates and annual generation |
|
|
293
|
+
| [Product Recalls API](https://dataandapis.com/apis/product-recalls?ref=npm) | `client.productRecalls` | Every US consumer product recall since 1973 from the CPSC, searchable and refreshed daily, with UPC lookup |
|
|
294
|
+
| [Quotes API](https://dataandapis.com/apis/quotes?ref=npm) | `client.quotes` | Random and by-id quotes with authors across motivation, wisdom, love and humour |
|
|
295
|
+
| [River Conditions API](https://dataandapis.com/apis/rivers?ref=npm) | `client.rivers` | Live streamflow, gage height and water temperature from 11,605 USGS river gauges, with nearest-gauge lookup |
|
|
296
|
+
| [Space Launches API](https://dataandapis.com/apis/space-launches?ref=npm) | `client.spaceLaunches` | All 7,391 orbital launches since Sputnik plus the live upcoming schedule, with vehicle, site, agency and outcome |
|
|
297
|
+
| [Thesaurus API](https://dataandapis.com/apis/thesaurus?ref=npm) | `client.thesaurus` | Synonyms and antonyms for English words, grouped by part of speech and ranked by sense, from WordNet 3.1 |
|
|
298
|
+
| [Tides API](https://dataandapis.com/apis/tides?ref=npm) | `client.tides` | NOAA tide predictions for 3,499 US stations with nearest-station lookup, straight from CO-OPS |
|
|
299
|
+
| [Trending API](https://dataandapis.com/apis/trending?ref=npm) | `client.trending` | The most-read Wikipedia articles for any day and language, with internal pages filtered out |
|
|
300
|
+
| [US Lawyers API](https://dataandapis.com/apis/us-lawyers?ref=npm) | `client.usLawyers` | Search 14 state bar directories through one API: verify an attorney's licence, status and admission |
|
|
301
|
+
| [VIN Decoder API](https://dataandapis.com/apis/vin-decoder?ref=npm) | `client.vinDecoder` | Decode any 17-character VIN into make, model, year, engine, body and plant details |
|
|
302
|
+
| [Weather API](https://dataandapis.com/apis/weather?ref=npm) | `client.weather` | Current conditions, 48-hour hourly and 9-day daily forecasts for any coordinates, metric or imperial |
|
|
303
|
+
| [Zip & Postal Code API](https://dataandapis.com/apis/zip-postal-code?ref=npm) | `client.zipPostalCode` | Postal and ZIP code lookup for about 100 countries, with place, region and coordinates |
|
|
304
|
+
|
|
305
|
+
### Education
|
|
306
|
+
|
|
307
|
+
| API | On the client | What it does |
|
|
308
|
+
|---|---|---|
|
|
309
|
+
| [Chemical Elements API](https://dataandapis.com/apis/elements?ref=npm) | `client.elements` | All 118 chemical elements with NIST properties: mass, configuration, electronegativity, melting points and more |
|
|
310
|
+
| [Universities API](https://dataandapis.com/apis/universities?ref=npm) | `client.universities` | 6,273 US colleges with admission rate, tuition, net price, completion, debt and earnings, plus 10,240 world universities |
|
|
311
|
+
|
|
312
|
+
### Entertainment
|
|
313
|
+
|
|
314
|
+
| API | On the client | What it does |
|
|
315
|
+
|---|---|---|
|
|
316
|
+
| [Anime API](https://dataandapis.com/apis/anime?ref=npm) | `client.anime` | 24,000 anime titles with episodes, airing schedules, scores and genres, refreshed hourly |
|
|
317
|
+
| [Artworks API](https://dataandapis.com/apis/artworks?ref=npm) | `client.artworks` | 132,739 artworks from the Art Institute of Chicago with artist, medium, dates, flags and IIIF image URLs |
|
|
318
|
+
| [Day In History API](https://dataandapis.com/apis/day-in-history?ref=npm) | `client.dayInHistory` | Events, births, deaths and holidays for any day of the year from Wikipedia's On This Day, with thumbnails |
|
|
319
|
+
| [Horoscope & Zodiac API](https://dataandapis.com/apis/horoscope-zodiac?ref=npm) | `client.horoscopeZodiac` | Daily horoscopes for the 12 signs with mood, lucky number and colour, plus sign facts and date-to-sign lookup |
|
|
320
|
+
| [Jokes API](https://dataandapis.com/apis/jokes?ref=npm) | `client.jokes` | 252 original, clean jokes in 12 categories, random, searchable and safe for any audience |
|
|
321
|
+
| [Lottery API](https://dataandapis.com/apis/lottery?ref=npm) | `client.lottery` | Lottery providers and historical draw results with winning numbers, jackpots and prize tiers, searchable |
|
|
322
|
+
| [Manga, Manhua And Manhwa API](https://dataandapis.com/apis/manga-manhua-manhwa?ref=npm) | `client.mangaManhuaManhwa` | Manga, manhua and manhwa catalogue with genres, status and authors, searchable by title |
|
|
323
|
+
| [Movies & TV API](https://dataandapis.com/apis/movies?ref=npm) | `client.movies` | 232,658 movies and TV series from Wikidata, CC0, with IMDb and TMDB ids, cast, genres and runtime |
|
|
324
|
+
| [Notable People API](https://dataandapis.com/apis/notable-people?ref=npm) | `client.notablePeople` | 1.93 million notable people from Wikidata with birth and death dates, occupations and a notability rank |
|
|
325
|
+
| [Novels API](https://dataandapis.com/apis/novel?ref=npm) | `client.novel` | East Asian novels catalogue with genres, status and authors, from classics to web novels |
|
|
326
|
+
| [Public Domain Books API](https://dataandapis.com/apis/books?ref=npm) | `client.books` | All 78,037 Project Gutenberg ebooks in 56 languages with full-text search and download links |
|
|
327
|
+
| [Riddles API](https://dataandapis.com/apis/riddles?ref=npm) | `client.riddles` | 176 curated riddles with answers in 8 categories and three difficulties, built for quiz and game UIs |
|
|
328
|
+
| [Trivia API](https://dataandapis.com/apis/trivia?ref=npm) | `client.trivia` | 5,298 multiple-choice and true-or-false trivia questions in 24 categories and three difficulties |
|
|
329
|
+
| [Video Games API](https://dataandapis.com/apis/video-games?ref=npm) | `client.videoGames` | 31,336 video games from Wikidata, CC0, with platforms, genres, developers, publishers and Steam app ids |
|
|
330
|
+
|
|
331
|
+
### Events
|
|
332
|
+
|
|
333
|
+
| API | On the client | What it does |
|
|
334
|
+
|---|---|---|
|
|
335
|
+
| [Public Holidays API](https://dataandapis.com/apis/public-holidays?ref=npm) | `client.publicHolidays` | 23,786 public holidays for 204 countries from 2020 to 2028, with regional scope and long weekends |
|
|
336
|
+
|
|
337
|
+
### Finance
|
|
338
|
+
|
|
339
|
+
| API | On the client | What it does |
|
|
340
|
+
|---|---|---|
|
|
341
|
+
| [Banks API](https://dataandapis.com/apis/banks?ref=npm) | `client.banks` | All 27,833 FDIC-insured banks, 78,075 branches with coordinates and every failure since 1934, refreshed daily |
|
|
342
|
+
| [BIN & Card Validator API](https://dataandapis.com/apis/bin-card-validator?ref=npm) | `client.binCardValidator` | Card scheme from a BIN and full-number validation with Luhn and length rules, nothing stored |
|
|
343
|
+
| [Company Financials API](https://dataandapis.com/apis/company-financials?ref=npm) | `client.companyFinancials` | Annual revenue, profit, cash flow and balance sheet for 10,400 SEC filers, up to 25 years back |
|
|
344
|
+
| [Crypto Price API](https://dataandapis.com/apis/crypto-prices?ref=npm) | `client.cryptoPrices` | Live Coinbase spot prices for 400+ crypto assets in 170+ currencies, with candles and 24h stats |
|
|
345
|
+
| [Currency Exchange Rates API](https://dataandapis.com/apis/currency-rates?ref=npm) | `client.currencyRates` | ECB reference exchange rates for 30 currencies with conversion, 90-day lookups and history |
|
|
346
|
+
| [IBAN & SWIFT/BIC Validator API](https://dataandapis.com/apis/iban-swift-validator?ref=npm) | `client.ibanSwiftValidator` | Validate IBANs with the mod-97 checksum and parse SWIFT/BIC codes into bank, country, location and branch |
|
|
347
|
+
| [Inflation API](https://dataandapis.com/apis/inflation?ref=npm) | `client.inflation` | US inflation calculator and CPI data since 1913: what $100 from 1990 is worth today, and why |
|
|
348
|
+
| [Mortgage & Loan Calculator API](https://dataandapis.com/apis/mortgage-loan-calculator?ref=npm) | `client.mortgageLoanCalculator` | Monthly payment, total interest and a full amortisation schedule for any fixed-rate loan or mortgage |
|
|
349
|
+
| [Sales Tax & VAT API](https://dataandapis.com/apis/sales-tax-vat?ref=npm) | `client.salesTaxVat` | VAT and GST rates for 52 countries, US state sales tax for all 50 states, and a calculator |
|
|
350
|
+
| [Sanctions Screening API](https://dataandapis.com/apis/sanctions?ref=npm) | `client.sanctions` | Screen names against OFAC, UN, EU and UK sanctions lists plus PEPs, with fuzzy matching |
|
|
351
|
+
| [Stock Tickers API](https://dataandapis.com/apis/stock-tickers?ref=npm) | `client.stockTickers` | Every US-listed symbol, 13,155 of them, with exchange, ETF flag and SEC CIK, refreshed nightly |
|
|
352
|
+
| [Trading Calendar API](https://dataandapis.com/apis/trading-calendar?ref=npm) | `client.tradingCalendar` | Is the US stock market open? NYSE and Nasdaq holidays, early closes and trading-day math, 1998 to 2200 |
|
|
353
|
+
| [VAT Validation API](https://dataandapis.com/apis/vat?ref=npm) | `client.vat` | Validate EU VAT numbers against VIES with registered name and address where disclosed |
|
|
354
|
+
|
|
355
|
+
### Food
|
|
356
|
+
|
|
357
|
+
| API | On the client | What it does |
|
|
358
|
+
|---|---|---|
|
|
359
|
+
| [Cocktails API](https://dataandapis.com/apis/cocktails?ref=npm) | `client.cocktails` | 46 classic cocktails and mocktails with ingredients, measures, glassware, garnish and instructions |
|
|
360
|
+
| [Food Nutrition Information API](https://dataandapis.com/apis/food-nutrition-information?ref=npm) | `client.foodNutritionInformation` | Nutrition facts by food name: calories, macronutrients and key micronutrients per serving |
|
|
361
|
+
| [Pokemon Unite Pokemons API](https://dataandapis.com/apis/pokemon-unite?ref=npm) | `client.pokemonUnite` | Every playable Pokémon Unite character with role, stats, abilities and battle items |
|
|
362
|
+
| [Recipes API](https://dataandapis.com/apis/recipes?ref=npm) | `client.recipes` | 115 curated home-cook recipes across 21 cuisines with quantities, steps, timings and dietary flags |
|
|
363
|
+
|
|
364
|
+
### Gaming
|
|
365
|
+
|
|
366
|
+
| API | On the client | What it does |
|
|
367
|
+
|---|---|---|
|
|
368
|
+
| [Hearthstone API](https://dataandapis.com/apis/hearthstone?ref=npm) | `client.hearthstone` | Every Hearthstone card from Blizzard's data with class, set, cost, rarity, mechanics and text, twice-daily refresh |
|
|
369
|
+
|
|
370
|
+
### Health
|
|
371
|
+
|
|
372
|
+
| API | On the client | What it does |
|
|
373
|
+
|---|---|---|
|
|
374
|
+
| [Calories Burned API](https://dataandapis.com/apis/calories-burned?ref=npm) | `client.caloriesBurned` | Calories burned for 1,111 activities from the 2024 Compendium of Physical Activities, by weight and time |
|
|
375
|
+
| [Drugs API](https://dataandapis.com/apis/drugs?ref=npm) | `client.drugs` | 135,000 FDA drug products by NDC, joined with 17,900 recall reports |
|
|
376
|
+
| [Food Recalls API](https://dataandapis.com/apis/food-recalls?ref=npm) | `client.foodRecalls` | All 29,316 FDA food and supplement recalls since 2004, with class, reason, firm and distribution, synced nightly |
|
|
377
|
+
| [Healthcare Providers API](https://dataandapis.com/apis/healthcare-providers?ref=npm) | `client.healthcareProviders` | Look up any of 9.37 million US NPIs with specialties resolved to plain names |
|
|
378
|
+
|
|
379
|
+
### Lifestyle
|
|
380
|
+
|
|
381
|
+
| API | On the client | What it does |
|
|
382
|
+
|---|---|---|
|
|
383
|
+
| [Attractions API](https://dataandapis.com/apis/attractions?ref=npm) | `client.attractions` | 63,938 tourist attractions worldwide with coordinates, Wikipedia articles and 51,500 Commons photos, CC0 |
|
|
384
|
+
| [Travel Advisories API](https://dataandapis.com/apis/travel-advisories?ref=npm) | `client.travelAdvisories` | US State Department travel advisory levels for 213 destinations, with summaries and links, refreshed daily |
|
|
385
|
+
| [Watches API](https://dataandapis.com/apis/watches?ref=npm) | `client.watches` | 1,257 watch movements from 320 brands with type, dimensions, jewels, power reserve and beat rate |
|
|
386
|
+
|
|
387
|
+
### Monitoring
|
|
388
|
+
|
|
389
|
+
| API | On the client | What it does |
|
|
390
|
+
|---|---|---|
|
|
391
|
+
| [SSL Checker Api](https://dataandapis.com/apis/ssl-checker-api?ref=npm) | `client.sslChecker` | Check any hostname's TLS certificate: validity, issuer, covered names and days until expiry, live |
|
|
392
|
+
| [Wildfires API](https://dataandapis.com/apis/wildfires?ref=npm) | `client.wildfires` | Every active US wildfire from the National Interagency Fire Center, with acres, containment and location, live |
|
|
393
|
+
|
|
394
|
+
### Religion
|
|
395
|
+
|
|
396
|
+
| API | On the client | What it does |
|
|
397
|
+
|---|---|---|
|
|
398
|
+
| [Bible Multi-Translation API](https://dataandapis.com/apis/bible-multi-translation?ref=npm) | `client.bibleMultiTranslation` | Verses from multiple Bible translations by book, chapter and verse, with version metadata |
|
|
399
|
+
|
|
400
|
+
### Technology
|
|
401
|
+
|
|
402
|
+
| API | On the client | What it does |
|
|
403
|
+
|---|---|---|
|
|
404
|
+
| [Mobile Devices API](https://dataandapis.com/apis/mobile-devices?ref=npm) | `client.mobileDevices` | Smartphone, tablet and smartwatch specifications by brand: display, cameras, battery, memory and more |
|
|
405
|
+
|
|
406
|
+
### Text Processing
|
|
407
|
+
|
|
408
|
+
| API | On the client | What it does |
|
|
409
|
+
|---|---|---|
|
|
410
|
+
| [Translation API](https://dataandapis.com/apis/translation?ref=npm) | `client.translation` | Translate text between about 100 languages with a model that runs on the platform, no third-party keys |
|
|
411
|
+
|
|
412
|
+
### Tools
|
|
413
|
+
|
|
414
|
+
| API | On the client | What it does |
|
|
415
|
+
|---|---|---|
|
|
416
|
+
| [Barcode Lookup API](https://dataandapis.com/apis/barcode-lookup?ref=npm) | `client.barcodeLookup` | Product name, brand, ingredients and Nutri-Score for 4.3 million barcodes |
|
|
417
|
+
| [Colors API](https://dataandapis.com/apis/colors?ref=npm) | `client.colors` | Name, convert and check contrast for any color, with 31,919 curated names and WCAG math |
|
|
418
|
+
| [Disposable Email Checker API](https://dataandapis.com/apis/disposable-email-checker?ref=npm) | `client.disposableEmailChecker` | Check an email or domain against 12,000 disposable mail providers, subdomains included |
|
|
419
|
+
| [DNS & WHOIS Lookup API](https://dataandapis.com/apis/dns-whois-lookup?ref=npm) | `client.dnsWhoisLookup` | DNS records over DNS-over-HTTPS and domain registration data over RDAP, in clean JSON |
|
|
420
|
+
| [Email Validation API](https://dataandapis.com/apis/email-validation?ref=npm) | `client.emailValidation` | Syntax, live MX check, disposable detection and typo suggestions for any email address |
|
|
421
|
+
| [Emoji API](https://dataandapis.com/apis/emoji?ref=npm) | `client.emoji` | All 3,944 Unicode 17.0 emoji with names, groups, codepoints, shortcodes and keywords, searchable |
|
|
422
|
+
| [Language Detection API](https://dataandapis.com/apis/language-detection?ref=npm) | `client.languageDetection` | Detect the language of any text from 180 candidates with confidence scores and ranked alternatives |
|
|
423
|
+
| [Logos API](https://dataandapis.com/apis/logos?ref=npm) | `client.logos` | Every icon a website publishes, scored and served as an image, from just the domain |
|
|
424
|
+
| [Lorem Ipsum API](https://dataandapis.com/apis/lorem-ipsum?ref=npm) | `client.loremIpsum` | Words, sentences or paragraphs of Lorem Ipsum on demand for layouts, mockups and test data |
|
|
425
|
+
| [Name Intelligence API](https://dataandapis.com/apis/name-intelligence?ref=npm) | `client.nameIntelligence` | Gender inference with real probabilities and popularity history for 105,966 first names and 162,253 surnames |
|
|
426
|
+
| [Password Generator API](https://dataandapis.com/apis/password-generator?ref=npm) | `client.passwordGenerator` | Strong random passwords with the length and character classes you choose, generated with cryptographic randomness |
|
|
427
|
+
| [Phone Number Validation API](https://dataandapis.com/apis/phone-validation?ref=npm) | `client.phoneValidation` | Validate, type and format phone numbers for every country in E.164, international and national forms |
|
|
428
|
+
| [Random User API](https://dataandapis.com/apis/random-user?ref=npm) | `client.randomUser` | Realistic fake users for ten countries, internally consistent and seedable, never real people |
|
|
429
|
+
| [Spell Check API](https://dataandapis.com/apis/spell-check?ref=npm) | `client.spellCheck` | English spell check with ranked did-you-mean suggestions from a 132,729-word dictionary |
|
|
430
|
+
| [Tech Stack API](https://dataandapis.com/apis/tech-stack?ref=npm) | `client.techStack` | Detect the CMS, frameworks, analytics, payments, CDN and hosting behind any website |
|
|
431
|
+
| [Unit Converter API](https://dataandapis.com/apis/unit-converter?ref=npm) | `client.unitConverter` | Convert length, mass, volume, temperature, speed, energy, pressure and more between units in one call |
|
|
432
|
+
| [URL Metadata API](https://dataandapis.com/apis/url-metadata?ref=npm) | `client.urlMetadata` | Title, description, Open Graph, Twitter Card, canonical and favicon for any public URL |
|
|
433
|
+
| [User Agent Parser API](https://dataandapis.com/apis/user-agent-parser?ref=npm) | `client.userAgentParser` | Browser, engine, OS, device and CPU from any User-Agent string, or from the caller's own |
|
|
434
|
+
|
|
435
|
+
### Transportation
|
|
436
|
+
|
|
437
|
+
| API | On the client | What it does |
|
|
438
|
+
|---|---|---|
|
|
439
|
+
| [Aircraft Registrations API](https://dataandapis.com/apis/aircraft-registrations?ref=npm) | `client.aircraftRegistrations` | The full FAA registry: 316,483 US aircraft by tail number or Mode S hex, with owner, model and airworthiness |
|
|
440
|
+
| [Airlines API](https://dataandapis.com/apis/airlines?ref=npm) | `client.airlines` | 4,650 airlines past and present with IATA and ICAO codes, callsigns, alliances and hub airports |
|
|
441
|
+
| [Airport Status API](https://dataandapis.com/apis/airport-status?ref=npm) | `client.airportStatus` | Live FAA delays for US airports: closures, ground stops, ground delay programs and arrival and departure delays |
|
|
442
|
+
| [Fuel Stations API](https://dataandapis.com/apis/fuel-stations?ref=npm) | `client.fuelStations` | 14,070 US and Canadian stations for E85, propane, biodiesel, CNG, renewable diesel, hydrogen and LNG |
|
|
443
|
+
| [Seaports API](https://dataandapis.com/apis/seaports?ref=npm) | `client.seaports` | 3,805 seaports in 195 countries from the NGA World Port Index: depths, vessel limits, facilities and UN/LOCODE |
|
|
444
|
+
| [Traffic Fatalities API](https://dataandapis.com/apis/traffic-fatalities?ref=npm) | `client.trafficFatalities` | Every fatal US road crash from 2016 to 2023: 289,625 crashes with location, conditions and drinking-driver counts |
|
|
445
|
+
| [Vehicle Recalls API](https://dataandapis.com/apis/vehicle-recalls?ref=npm) | `client.vehicleRecalls` | Every NHTSA recall since 1967 and 2.24 million owner complaints by make, model and year |
|
|
446
|
+
|
|
447
|
+
### Utilities
|
|
448
|
+
|
|
449
|
+
| API | On the client | What it does |
|
|
450
|
+
|---|---|---|
|
|
451
|
+
| [Barcode Generator API](https://dataandapis.com/apis/barcode-generator?ref=npm) | `client.barcodeGenerator` | Generate Code 128, EAN, UPC, Code 39, ITF-14, Data Matrix, PDF417 and more as SVG or PNG |
|
|
452
|
+
| [HTML Render](https://dataandapis.com/apis/html-render?ref=npm) | `client.htmlRender` | HTML to PDF, PNG, JPEG or WebP with headless Chromium: full CSS, web fonts and JavaScript |
|
|
453
|
+
| [Profanity Filter API](https://dataandapis.com/apis/profanity-filter?ref=npm) | `client.profanityFilter` | Detect and censor profanity in English and Spanish with three severity tiers, so you filter only what you mean to |
|
|
454
|
+
| [QR Code Generator API](https://dataandapis.com/apis/qr-code-generator?ref=npm) | `client.qrCodeGenerator` | QR codes for any text or URL as PNG, SVG or base64, with size, margin, error correction and colours |
|
|
455
|
+
| [Random Image & Placeholder API](https://dataandapis.com/apis/random-image?ref=npm) | `client.randomImage` | Placeholder images as SVG with solid or gradient backgrounds, a label and automatic contrast text |
|
|
456
|
+
| [Timezone & World Time API](https://dataandapis.com/apis/timezone-world-time?ref=npm) | `client.timezoneWorldTime` | Current local time, UTC offset and daylight-saving status for any of 400+ IANA timezones |
|
|
457
|
+
<!-- apis:end -->
|
|
458
|
+
|
|
459
|
+
## Links
|
|
460
|
+
|
|
461
|
+
- [Catalog and documentation](https://dataandapis.com/apis?ref=npm)
|
|
462
|
+
- [Pricing](https://dataandapis.com/pricing?ref=npm)
|
|
463
|
+
- [Contact](https://dataandapis.com/contact?ref=npm)
|
|
464
|
+
- [MCP server for AI assistants](https://dataandapis.com/mcp/setup?ref=npm)
|
|
465
|
+
|
|
466
|
+
## License
|
|
467
|
+
|
|
468
|
+
MIT
|