Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
crypto-news-api
Advanced tools
Readme
Official Node.js client for the CryptoControl.io API. The CryptoControl Node.js client lets developers access rich formatted articles from cryptonews sources from all around the world.
npm install crypto-news-api --save
bower install crypto-news-api --save
<script src="./bower_components/crypto-news-api/dist/bundle.js"></script>
First make sure that you've recieved an API key by visiting https://cryptocontrol.io/apis. With the API key, you can write the following code.
import CryptoNewsApi from 'crypto-news-api'
// For ES5, use the below import instead
// var CryptoNewsAPI = require('crypto-news-api').default
// Connect to the CryptoControl API
const Api = new CryptoNewsAPI('API_KEY_HERE')
// Connect to a self-hosted proxy server (to improve performance) that points to cryptocontrol.io
const ProxyApi = new CryptoNewsAPI('API_KEY_HERE', 'http://cryptocontrol_proxy/api/v1/public')
// Enable the sentiment datapoints
Api.enableSentiment()
// Get top news
Api.getTopNews()
.then(function (articles) { console.log(articles) })
.catch(function (error) { console.log(error) })
// Get latest russian news
Api.getTopNews("ru")
.then(function (articles) { console.log(articles) })
.catch(function (error) { console.log(error) })
// Get top news for Bitcoin
Api.getTopNewsByCoin("bitcoin")
.then(function (articles) { console.log(articles) })
.catch(function (error) { console.log(error) })
// Get latest tweets for EOS
Api.getLatestTweetsByCoin("eos")
.then(function (tweets) { console.log(tweets) })
.catch(function (error) { console.log(error) })
// Get latest reddit posts for Ripple
Api.getLatestRedditPostsByCoin("ripple")
.then(function (redditPosts) { console.log(redditPosts) })
.catch(function (error) { console.log(error) })
// Get a combined feed (reddit/twitter/articles) for Litecoin
Api.getTopFeedByCoin("litecoin")
.then(function (feed) { console.log(feed) })
.catch(function (error) { console.log(error) })
// Get all reddit/tweets/articles (separated) for NEO
Api.getTopItemsByCoin("neo")
.then(function (feed) { console.log(feed) })
.catch(function (error) { console.log(error) })
// Get coin details for ethereum
Api.getCoinDetails("ethereum")
.then(function (details) { console.log(details) })
.catch(function (error) { console.log(error) })
<script src="./bower_components/crypto-news-api/dist/bundle.js"></script>
<script>
const Api = new window.CryptoNewsApi('API_KEY_HERE')
// Get top news
Api.getTopNews()
.then(function (articles) { console.log(articles) })
.catch(function (error) { console.log(error) })
// Get latest russian news
Api.getTopNews("ru")
.then(function (articles) { console.log(articles) })
.catch(function (error) { console.log(error) })
// ... same functions as demonstrated above
</script>
lang
allows developers to choose which language they'd like to get the feed. Currently the CryptoControl API supports the following languages:
en
default)cn
)de
)it
)jp
)ko
)po
)ru
)es
)The coin slugs are the coin id's used from the CoinMarketCap api. You can see the full list of coins here: https://api.coinmarketcap.com/v1/ticker/?limit=2000
enableSentiment()
will tell CrpytoControl to return articles/reddit/twitter with sentiment datapoints as well (ie. how much +ve/-ve an article is). This feature is for CryptoControl premium users only.
[{
"hotness": 70862.60323026273,
"activityHotness": 4.601980262729618,
"primaryCategory": "General",
"words": 1444,
"similarArticles": [
{
"_id": "5b363b525b113200191a1d5f",
"publishedAt": "2018-06-29T13:42:44.000Z",
"title": "Op-Ed: Challenge of Mining Centralization Unveils Bitcoin’s Elegant Design",
"url": "https://cryptocontrol.io/r/api/article/5b363b525b113200191a1d5f?ref=5ac11440ec0af7be35528459",
"source": {
"_id": "59d8c361ef8bf95cc2bfb66f",
"name": "Bitcoin Magazine",
"url": "https://bitcoinmagazine.com/"
},
"sourceDomain": "bitcoinmagazine.com",
"thumbnail": null
},
{
"_id": "5b3865405c5681000f2f7407",
"publishedAt": "2018-06-30T14:58:00.000Z",
"title": "Arbitration on a Governed Blockchain: EOS’ Crisis of Dispute Resolution",
"url": "https://cryptocontrol.io/r/api/article/5b3865405c5681000f2f7407?ref=5ac11440ec0af7be35528459",
"source": {
"_id": "59d70be3ef8bf95cc2aa2b4f",
"name": "CoinTelegraph",
"url": "https://cointelegraph.com/"
},
"sourceDomain": "cointelegraph.com",
"thumbnail": null
}
],
"coins": [
{
"_id": "59cb59f9b0836b0a63aebc7c",
"name": "Ethereum",
"tradingSymbol": "eth",
"slug": "ethereum"
},
{
"_id": "59d21e9b83a0523906a45dc5",
"name": "EOS",
"slug": "eos",
"tradingSymbol": "eos"
}
],
"_id": "5b3a2e1b104844000fd64e28",
"description": "The EOS governance disaster offers a strong reminder of how entrenched human mistrust can be difficult to overcome.",
"publishedAt": "2018-07-02T12:00:27.000Z",
"title": "It's Too Soon for On-Chain Governance - CoinDesk",
"url": "https://cryptocontrol.io/r/api/article/5b3a2e1b104844000fd64e28?ref=5ac11440ec0af7be35528459",
"source": {
"_id": "59ce11393a44cf289a9a71f5",
"name": "CoinDesk",
"url": "http://coindesk.com"
},
"thumbnail": "https://cryptocontrol.io/r/thumbnail/5b3a2e1b104844000fd64e28?ref=5ac11440ec0af7be35528459",
"sourceName": "CoinDesk",
"sourceUrl": "http://coindesk.com",
"sourceDomain": "coindesk.com",
"originalImageUrl": "https://media.coindesk.com/uploads/2018/06/shutterstock_153840266-e1530230263310.jpg"
}]
FAQs
API to get a crypto newsfeed in your app
The npm package crypto-news-api receives a total of 26 weekly downloads. As such, crypto-news-api popularity was classified as not popular.
We found that crypto-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
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.