crypto-news-api
Advanced tools
Comparing version 1.0.2 to 1.0.3
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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14159
7
269
65