
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
alchemy-news-api
Advanced tools
This module provides calls to the Alchemy News API for Nodejs. It is based on AlchemyAPI for Nodejs. For more information on the API requests and responses, visit the AlchemyData News API docs. To use this module, you will need to obtain a key from Alchemy.
You can install this through npm: npm install alchemy-news-api
You can install via git by cloning: git clone https://github.com/davidadamojr/alchemy-news-api.git /path/to/alchemy-news-api
var AlchemyNewsAPI = require('alchemy-news-api');
var alchemyNewsAPI = new alchemyNews('<YOUR API KEY>');
var taxonomyQuery = {
'taxonomy_label': 'politics',
'return': ['url', 'title']
};
alchemyNewsAPI.getNewsByTaxonomy(taxonomyQuery, function (error, response) {
if (error) {
console.log(error);
} else {
console.log(response);
// do something with response
}
});
To run tests type mocha
Retrieve categorized news content by searching for news on topics that you care about e.g. baseball, mobile phones, etc.
var AlchemyNewsAPI = require('alchemy-news-api');
var alchemyNewsAPI = new alchemyNews('<YOUR API KEY>');
var taxonomyQuery = {
'taxonomy_label': 'baseball',
'return': ['url', 'title']
};
alchemyNewsAPI.getNewsByTaxonomy(taxonomyQuery, function (error, response) {
if (error) {
console.log(error);
} else {
// do something with response
console.log(response);
}
});
Retrieve news content containing abstract concepts.
var AlchemyNewsAPI = require('alchemy-news-api');
var alchemyNewsAPI = new alchemyNews('<YOUR API KEY>');
var conceptQuery = {
'concept_text': 'Android',
'return': ['url', 'title']
};
alchemyNewsAPI.getNewsByConcept(conceptQuery, function (error, response) {
if (error) {
console.log(error);
} else {
// do something with response
console.log(response);
}
});
Retrieve news content containing specified keywords. Keywords are terms explicitly mentioned in the article that are determined to be highly relevant to the subject matter of the news article.
var AlchemyNewsAPI = require('alchemy-news-api');
var alchemyNewsAPI = new alchemyNews('<YOUR API KEY>');
var keywordQuery = {
'keyword_text': 'Clinton',
'return': ['url', 'title']
};
alchemyNewsAPI.getNewsByKeyword(keywordQuery, function (error, response) {
if (error) {
console.log(error);
} else {
// do something with response
console.log(response);
}
});
Retrieve news articles using named entities. Named entities are proper nouns such as people, cities, companies, products, etc.
var AlchemyNewsAPI = require('alchemy-news-api');
var alchemyNewsAPI = new alchemyNews('<YOUR API KEY>');
var entityQuery = {
'entity_text': 'Apple',
'entity_type': 'company',
'return': ['url', 'title']
};
alchemyNewsAPI.getNewsByEntity(entityQuery, function (error, response) {
if (error) {
console.log(error);
} else {
// do something with response
console.log(response);
}
});
Retrieve news articles based on sentiment. Articles have positive, negative or neutral sentiment.
var AlchemyNewsAPI = require('alchemy-news-api');
var alchemyNewsAPI = new alchemyNews('<YOUR API KEY>');
var sentimentQuery = {
'title': 'IBM',
'sentiment_type': 'positive',
'sentiment_score': '>0.5',
'return': ['url', 'title']
};
alchemyNewsAPI.getNewsBySentiment(sentimentQuery, function (error, response) {
if (error) {
console.log(error);
} else {
// do something with response
console.log(response);
}
});
This Nodejs library does not implement all the capabilities of the Alchemy News API. So there is still a lot that can be added. Contributions and improvements are welcome.
FAQs
An Alchemy News API library for Node.js
The npm package alchemy-news-api receives a total of 0 weekly downloads. As such, alchemy-news-api popularity was classified as not popular.
We found that alchemy-news-api demonstrated a not healthy version release cadence and project activity because the last version was released 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
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.