Sign In

@apifreaks/openapi-specs

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apifreaks/openapi-specs

Public OpenAPI 3.1 specifications for all APIFreaks API products.

latest
Source
npmnpm
Version
0.3.0
Version published
Weekly downloads
283
1079.17%
Maintainers
2
Weekly downloads
 
Created
Source

@apifreaks/openapi-specs

OpenAPI 3.1 specifications for all APIFreaks API products. Ships 102 production specs across 21 categories as typed JSON, importable as ESM, CJS, or raw JSON.

Install

npm install @apifreaks/openapi-specs

Usage

Programmatic API

import {
  getSpec,
  getSpecsByCategory,
  SPEC_SLUGS,
  SPEC_CATEGORIES,
  SPECS_BY_CATEGORY,
} from "@apifreaks/openapi-specs";

// Get a single spec by slug
const spec = getSpec("ip-locator");

// Get all slugs in a category
const ipSlugs = getSpecsByCategory("ip-intelligence");

// All available slugs
console.log(SPEC_SLUGS); // ['ip-locator', 'dns-lookup', ...]

// All categories
console.log(SPEC_CATEGORIES); // ['currency', 'dns', 'ip-intelligence', ...]

// All slugs grouped by category
console.log(SPECS_BY_CATEGORY);

Direct JSON import (tree-shakable)

import ipLocator from "@apifreaks/openapi-specs/specs/ip-intelligence/ip-locator.json";

CommonJS

const { getSpec, SPEC_SLUGS } = require("@apifreaks/openapi-specs");

API

ExportTypeDescription
getSpec(slug)(string) => OpenAPISpec | undefinedReturns the full spec object for a given slug
getSpecsByCategory(category)(string) => string[]Returns all slugs in a category, or [] if unknown
SPEC_SLUGSstring[]All 102 spec slugs
SPEC_CATEGORIESstring[]All 21 category names
SPECSRecord<string, OpenAPISpec>Full spec objects keyed by slug
SPECS_BY_CATEGORYRecord<string, string[]>Slugs grouped by category

Types

import type { OpenAPISpec } from "@apifreaks/openapi-specs";

// OpenAPISpec has: openapi, info, servers?, paths?, components?, [key: string]

Categories

CategoryCountDescription
commodity5Commodity prices, symbols, time series
currency10Exchange rates, conversion, historical data
dns4DNS lookup, reverse DNS, history
domain4Domain search, checker, subdomain lookup
email-validation2Email verification and bulk validation
financial8VAT rates, IBAN/SWIFT validation
general1Usage and credits
geocoding2Forward and reverse geocoding
geodb10Countries, cities, regions, flags, administrative units
ip-intelligence4IP geolocation, threat intelligence, bulk lookup
other1Astronomy data
pdf19PDF manipulation, conversion, encryption
phone-validation2Phone number validation
scraper1Web scraping
screenshot2Website screenshots
ssl2SSL certificate lookup
timezone2Timezone lookup and conversion
user-agent2User-agent parsing
weather8Current, forecast, historical, marine weather
whois6WHOIS lookup, ASN, reverse WHOIS
zip-code7Zip code lookup, distance, radius search

Development

# Install deps
npm install

# Generate manifest (auto-discovers specs/ and writes src/manifest.ts)
npm run generate

# Build (generate + tsup)
npm run build

# Typecheck
npm run typecheck

# Test
npm test

Project structure

specs/               # OpenAPI 3.1 JSON files, organized by category
  currency/
    currency-converter.json
  ip-intelligence/
    ip-locator.json
  ...
src/
  index.ts           # Public API
  manifest.ts        # AUTO-GENERATED — do not edit manually
  types.ts           # OpenAPISpec type definition
scripts/
  generate-manifest.ts   # Reads specs/, writes src/manifest.ts
test/
  validate.test.ts   # Validates every spec is valid JSON + well-formed OpenAPI

Adding a new spec

  • Add the .json file under the appropriate category in specs/
  • Run npm run generate to regenerate src/manifest.ts
  • Run npm test to validate
  • Run npm run build to rebuild the package

src/manifest.ts is auto-generated and must not be edited by hand.

Publishing

The package is built automatically before publish via prepublishOnly.

npm publish --access public

The published package includes only dist/ and specs/. Tests, scripts, and build configs are excluded.

License

MIT

Keywords

openapi

FAQs

Package last updated on 17 Aug 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts