
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
openalex-client
Advanced tools
A comprehensive TypeScript client for the OpenAlex academic database API. This SDK provides type-safe access to scholarly works, authors, institutions, sources, and concepts.
npm install openalex-client
import { OpenAlex } from "openalex-client";
// Initialize the SDK
const openAlex = new OpenAlex({
userAgent: "MyApp/1.0.0 (mailto:your-email@example.com)",
});
// Search for works
const works = await openAlex.works.list({
search: "artificial intelligence",
per_page: 10,
});
console.log(`Found ${works.meta.count} works`);
// Get a specific work by DOI
const work = await openAlex.works.getByDoi("10.1038/nature12373");
console.log(work.title);
// Get author information
const author = await openAlex.authors.get("A2208157607");
console.log(`${author.display_name} has ${author.works_count} works`);
const openAlex = new OpenAlex({
baseURL: "https://api.openalex.org", // API base URL
userAgent: "MyApp/1.0.0", // Required: Your app identifier
timeout: 30000, // Request timeout in ms
retries: 3, // Number of retry attempts
retryDelay: 1000, // Base delay between retries
});
// Search works
const works = await openAlex.works.list({
search: "machine learning",
filter: {
publication_year: "2023",
"open_access.is_oa": true,
},
sort: "cited_by_count:desc",
});
// Get works by author
const authorWorks = await openAlex.works.getByAuthor("A2208157607");
// Get citations
const citations = await openAlex.works.getCitedBy("W2741809807");
// Get open access works
const oaWorks = await openAlex.works.getOpenAccess({
filter: { publication_year: "2023" },
});
// Get author by ORCID
const author = await openAlex.authors.getByOrcid("0000-0002-1825-0097");
// Get authors from institution
const institutionAuthors = await openAlex.authors.getByInstitution("I27837315");
// Get highly cited authors
const topAuthors = await openAlex.authors.getHighlyCited({ per_page: 50 });
// Get co-authors
const coAuthors = await openAlex.authors.getCoAuthors("A2208157607");
// Get institution by ROR
const institution = await openAlex.institutions.getByRor("05dxps055");
// Get institutions by country
const usInstitutions = await openAlex.institutions.getByCountry("US");
// Get university-type institutions
const universities = await openAlex.institutions.getUniversities();
// Get institution's works
const institutionWorks = await openAlex.institutions.getWorks("I27837315");
// Get source by ISSN
const journal = await openAlex.sources.getByIssn("0028-0836");
// Get open access journals
const oaJournals = await openAlex.sources.getOpenAccess();
// Get journals in DOAJ
const doajJournals = await openAlex.sources.getDoajSources();
// Get sources by publisher
const springerJournals =
await openAlex.sources.getByPublisher("Springer Nature");
// Get concept hierarchy
const hierarchy = await openAlex.concepts.getHierarchy("C41008148");
// Get works related to concept
const conceptWorks = await openAlex.concepts.getWorks("C41008148");
// Get top-level concepts
const topConcepts = await openAlex.concepts.getTopLevel();
// Find similar concepts
const similar = await openAlex.concepts.findSimilar(
"machine learning algorithms",
);
// Using async generator for automatic pagination
for await (const work of openAlex.works.paginate({
search: "climate change",
})) {
console.log(work.title);
}
// Manual pagination
let page = 1;
let hasMore = true;
while (hasMore) {
const response = await openAlex.works.list({
search: "quantum computing",
page,
per_page: 100,
});
// Process works
response.results.forEach((work) => {
console.log(work.title);
});
hasMore = response.results.length === 100;
page++;
}
const works = await openAlex.works.list({
filter: {
"authorships.institutions.country_code": "US",
publication_year: "2020-2023",
"open_access.is_oa": true,
cited_by_count: ">100",
"concepts.id": "C41008148", // Computer Science
},
sort: "publication_date:desc",
});
const worksByYear = await openAlex.works.list({
group_by: "publication_year",
filter: {
"concepts.id": "C41008148",
},
});
console.log(worksByYear.group_by); // Aggregated results by year
// Select only specific fields to reduce response size
const works = await openAlex.works.list({
select: "id,title,publication_year,cited_by_count",
search: "artificial intelligence",
});
try {
const work = await openAlex.works.getByDoi("invalid-doi");
} catch (error) {
if (error.status_code === 404) {
console.log("Work not found");
} else {
console.error("API Error:", error.message);
}
}
# Install dependencies
npm install
# Build the project
npm run build
# Run linting
npm run lint
# Fix linting issues
npm run lint:fix
# Clean build directory
npm run clean
For detailed API documentation, visit OpenAlex API Documentation.
MIT License - see LICENSE file for details.
See CHANGELOG.md for version history and updates.
FAQs
TypeScript SDK for OpenAlex academic database API
We found that openalex-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.