
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
@goperigon/perigon-ts
Advanced tools
TypeScript client for the Perigon API
Fully-typed TypeScript SDK for the Perigon API. Access news articles, AI summaries, entity data, and more with complete type safety.
npm install @goperigon/perigon-ts
# yarn add @goperigon/perigon-ts
# pnpm add @goperigon/perigon-ts
# bun add @goperigon/perigon-ts
import { Configuration, V1Api } from "@goperigon/perigon-ts";
const perigon = new V1Api(
new Configuration({
apiKey: process.env.PERIGON_API_KEY,
}),
);
try {
const { articles } = await perigon.searchArticles({
q: "artificial intelligence",
size: 5,
});
console.log(`Found ${articles.length} articles`);
} catch (error) {
console.error("API Error:", error.message);
}
Get your API key from perigon.io:
# Environment variable (recommended)
export PERIGON_API_KEY="your_api_key_here"
// Or pass directly
const perigon = new V1Api(
new Configuration({
apiKey: "your_api_key_here",
}),
);
const { articles, numResults } = await perigon.searchArticles({
q: "technology AND startups",
source: ["techcrunch.com"],
from: "2024-01-01",
size: 10,
});
searchArticles
– Search news articles with advanced filtering by keywords, sources, dates, and morevectorSearchArticles
– Find semantically similar articles using AI-powered vector searchconst { results } = await perigon.searchCompanies({ name: "Apple", size: 5 });
searchCompanies
– Find companies with detailed business information, financials, and metadatasearchPeople
– Search for notable people and public figures across news and mediasearchJournalists
– Discover journalists and reporters by name, publication, or expertisegetJournalistById
– Get comprehensive profile data for a specific journalistconst { results } = await perigon.searchStories({
q: "climate change",
size: 5,
});
searchStories
– Find related article clusters and trending story threadssearchTopics
– Browse structured topic taxonomy and content categoriessearchSources
– Discover news sources, publications, and media outletsconst { summary } = await perigon.searchSummarizer({
q: "renewable energy",
size: 10,
});
searchSummarizer
– Generate AI-powered summaries from multiple articles on any topicconst { results } = await perigon.searchWikipedia({
q: "machine learning",
size: 10,
});
searchWikipedia
– Search Wikipedia articles with full-text matching and filteringvectorSearchWikipedia
– Find semantically related Wikipedia content using vector similarityAll errors extend ResponseError
and include status
& body
properties:
try {
const result = await perigon.searchArticles({ q: "test" });
} catch (error) {
if (error.status === 401) console.error("Invalid API key");
else if (error.status === 429) console.error("Rate limit exceeded");
else console.error("API Error:", error.message);
}
MIT © Perigon
FAQs
Typescript client for Perigon API
We found that @goperigon/perigon-ts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.