Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crypto-news-api

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crypto-news-api - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

test.ts

12

index.ts

@@ -30,3 +30,4 @@ import fetch from 'node-fetch'

url: string
thumbnail: string
thumbnail?: string
originalImageUrl?: string
}

@@ -68,7 +69,6 @@

})
}
public async getTopNews(): Promise<IArticle> {
public async getTopNews(): Promise<IArticle[]> {
return await this._fetch('/public/news')

@@ -78,3 +78,3 @@ }

public async getLatestNews(): Promise<IArticle> {
public async getLatestNews(): Promise<IArticle[]> {
return await this._fetch('/public/news', { latest: true })

@@ -89,3 +89,3 @@ }

public async getTopNewsByCoin(coinSlug: string): Promise<IArticle> {
public async getTopNewsByCoin(coinSlug: string): Promise<IArticle[]> {
return await this._fetch(`/public/news/coin/${coinSlug}`)

@@ -95,3 +95,3 @@ }

public async getLatestNewsByCoin(coinSlug: string): Promise<IArticle> {
public async getLatestNewsByCoin(coinSlug: string): Promise<IArticle[]> {
return await this._fetch(`/public/news/coin/${coinSlug}`, { latest: true })

@@ -98,0 +98,0 @@ }

{
"name": "crypto-news-api",
"version": "1.0.2",
"version": "1.0.3",
"description": "API to get a crypto newsfeed in your app",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -24,2 +24,13 @@ CryptoControl Crypto News API

## Available Functions
- **getTopNews()** Get the top news articles from the CryptoControl News API.
- **getLatestNews()** Get the latest news articles from the CryptoControl News API.
- **getTopNewsByCategory()** Get news articles grouped by category from the CryptoControl News API.
- **getTopNewsByCoin(coinSlug: String)** Get the top news articles for a specific coin from the CryptoControl API.
- **getLatestNewsByCoin(coinSlug: String)** Get the latest news articles for a specific coin from the CryptoControl News API.
- **getTopNewsByCoinCategory(coinSlug: String)** Get news articles grouped by category for a specific coin from the CryptoControl News API.
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](https://api.coinmarketcap.com/v1/ticker/?limit=2000)
## Sample Response from the API

@@ -26,0 +37,0 @@ ```javascript

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc