🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

@goperigon/perigon-ts

Package Overview
Dependencies
Maintainers
6
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@goperigon/perigon-ts

Typescript client for Perigon API

Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
75
-68.62%
Maintainers
6
Weekly downloads
 
Created
Source

Perigon logo

Perigon TypeScript SDK

TypeScript client for the Perigon API

npm version tests status documentation license

A fully-typed, promise-based SDK generated from the official Perigon OpenAPI specification. Works in Node.js, modern browsers, Cloudflare Workers, and Deno.

Table of Contents

✨ Features

  • Type-safe request/response models (goodbye any)
  • Ships as both ESM & CommonJS with sourcemaps
  • Zero-dependency core – bring your own fetch if needed
  • Generated directly from docs.perigon.io, so it’s always in sync
  • Runs in Node, browsers, Deno, and edge runtimes

📦 Installation

npm install @goperigon/perigon-ts
# yarn add @goperigon/perigon-ts
# pnpm add @goperigon/perigon-ts

🚀 Quick start

1. Instantiate the client

import { Configuration, V1Api } from "@goperigon/perigon-ts";

const perigon = new V1Api(
  new Configuration({
    apiKey: "YOUR_API_KEY", // or () => 'your_key'
    // basePath: 'https://api.perigon.io',      // override for proxy / dev
  }),
);

2. Make calls

// 🔍 Search recent news articles
const { articles, numResults } = await perigon.searchArticles({
  q: "artificial intelligence",
  size: 5,
});
console.log(numResults, articles[0].title);

// 👤 Look up a journalist by ID
const journalist = await perigon.getJournalistById({ id: "123456" });
console.log(journalist.name);

All SDK methods return typed promises with full IntelliSense support.

🧑‍💻 Endpoint snippets

Articles – search and filter news (/v1/all)

Docs → https://docs.perigon.io/docs/overview

const { articles } = await perigon.searchArticles({
  q: "technology",
  size: 5,
});

Articles – date range filter

Docs → https://docs.perigon.io/docs/overview

await perigon.searchArticles({
  q: "business",
  from: "2025-04-01",
  to: "2025-04-08",
});

Articles – restrict to a source

Docs → https://docs.perigon.io/docs/overview

await perigon.searchArticles({ source: ["nytimes.com"] });

Companies – fetch structured company data (/v1/companies)

Docs → https://docs.perigon.io/docs/company-data

const { results } = await perigon.searchCompanies({
  name: "Apple",
  size: 5,
});

Journalists – search and detail look‑up (/v1/journalists)

Docs → https://docs.perigon.io/docs/journalist-data

const { results } = await perigon.searchJournalists1({
  name: "Kevin",
  size: 1,
});
const journalist = await perigon.getJournalistById({ id: results[0].id });

Stories – discover related article clusters (/v1/stories)

Docs → https://docs.perigon.io/docs/stories-overview

await perigon.searchStories({ q: "climate change", size: 5 });

Vector search – semantic retrieval (/v1/vector)

Docs → https://docs.perigon.io/docs/vector-endpoint

await perigon.vectorSearchArticles({
  articleSearchParams: {
    prompt: "Latest advancements in artificial intelligence",
    size: 5,
  },
});

Summarizer – generate an instant summary (/v1/summarizer)

Docs → https://docs.perigon.io/docs/search-summarizer

const { summary } = await perigon.searchSummarizer({
  q: "renewable energy",
  size: 10,
});
console.log(summary);

Topics – explore taxonomy (/v1/topics)

Docs → https://docs.perigon.io/docs/topics

await perigon.searchTopics({ size: 10 });
ActionCode Example
Filter by sourceawait perigon.searchArticles({ source: ['nytimes.com'] })
Limit by date rangeawait perigon.searchArticles({ q: 'business', from: '2025‑04‑01', to: '2025‑04‑08' })
Company lookupawait perigon.searchCompanies({ name: 'Apple', size: 5 })
Summarize any queryawait perigon.searchSummarizer({ q: 'renewable energy', size: 20 })
Semantic / vector searchawait perigon.vectorSearchArticles({ articleSearchParams: { prompt: 'advancements in AI', size: 5 }})
Retrieve available taxonomic topicsawait perigon.searchTopics({ size: 10 })

Usage Examples

We have put together basic and advanced examples of accessing and using the Perigon API using the python SDK inside the examples/ folder.

🪪 License

MIT © Perigon

Keywords

perigon

FAQs

Package last updated on 23 Jul 2025

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