CryptoInfo

부분 유료
분류별 1EX | 업데이트됨 il y a 2 mois | Financial
인기

0.3 / 10

지연 시간

112ms

서비스 수준

0%

Health Check

N/A

모든 자습서로 돌아가기 (2)

Get request example

Where is

Full tutorial
Notebook for this tutorial
Google Colab for this tutorial

Get last 5 news

This query returns the last 5 published news.
You can test the request using the following Python code. When testing these requests through the built-in RapidAPI system, we had problems. Either the service did not respond, or code 307 was returned (we have nginx as a load balancer) without the ability to redirect the request. If you have similar difficulties with testing the API, try subscribing to the basic version and testing this code in person.

url = "https://cryptoinfo.p.rapidapi.com/api/private/latest_news/news"

headers = {
	"Content-Type": "application/json",
	"X-RapidAPI-Key": X_RAPIDAPI_KEY,
	"X-RapidAPI-Host": "cryptoinfo.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)
print(response.status_code)

Response description

  • Length of data: 5
  • Single news containing the next fields: dict_keys([‘meta’, ‘data’])
  • Meta information in news: {‘unique’: True, ‘topic’: ‘news’, ‘post_time’: ‘2023-01-31 08:35:04+00:00’, ‘hash’: 8797285867395575649}
  • unique – indicates whether the news is unique relative to others
  • post_time – is the time when this news was published in our API
  • hash – you can compare different news on hash. Very useful while using API endpoint instead of websocket to validate – if the obtained data is new in your application
  • Time of posting in our API: 2023-01-31 08:35:54+00:00 | 2023-01-31 08:35:04+00:00 | 2023-01-31 08:34:30+00:00 | 2023-01-31 08:33:35+00:00 | 2023-01-31 08:33:24+00:00
  • All time in our data can be decoded with format=%Y-%m-%d %H:%M:%S%z

Describing data field

  • Data field contains supported languages: dict_keys([‘en’, ‘ru’])
  • There are three fields that differ on languages: header, subheader, summary (generated summarization of the text)

en fields:

  • header: NFT Marketplace SudoSwap Airdrops Tokens to Liquidity Providers and 0xmon Holders
  • subheader: SUDO holders can vote on on-chain governance proposals, and the tokens are initially non-transferrable.
  • summary: SUDO holders can vote on on-chain governance proposals, and the tokens are initially non-transferrable. Eligible for the airdrop were early liquidity providers on SudoSwap as well as holders of 0xmon NFTs.

ru fields:

  • header: торговая площадка NFT sudoswap предоставляет токены airdrop поставщикам ликвидности и держателям 0xmon
  • subheader: держатели sudo могут голосовать за предложения по управлению on-chain, и токены изначально не подлежат передаче.
  • summary: держатели sudo могут голосовать за предложения по управлению on-chain, и токены изначально не подлежат передаче. право на airdrop имели ранние поставщики ликвидности на sudoswap, а также держатели 0xmon nft.

It is reasonable to ask - why send so much duplicated data in ru and en fields?
Our API is developing, and we do not exclude the possibility of adapting the remaining fields. But at the moment everything is as it is. Therefore, we strongly recommend using the appropriate key field for working with Russian/English languages.

Other fields we will consider only for en language. There are next keys:

  • dict_keys([‘header’, ‘subheader’, ‘content’, ‘link’, ‘date’, ‘domain’, ‘article_label’, ‘source_lang’, ‘is_breaking_news’, ‘hashtags_list’, ‘fields_tickers’, ‘summary’, ‘sentiment’, ‘article_type’, ‘blockwords’, ‘similarity’])
  • content – is the body of the article. header + subheader + content form a full article
  • url (link): https://www.coindesk.com/markets/2023/01/31/nft-marketplace-sudoswap-airdrops-tokens-to-liquidity-providers-and-0xmon-holders/?utm_medium=referral&utm_source=rss&utm_campaign=headlines
  • date – date of publish received from article html: 2023-01-31 08:25:04+00:00; It differs from meta-post time for the next reasons: 1) there are a lot of bugs on the article resources, that posts a news with incorrect datetime; 2) there are processing time of our service. Our common delay is about 30 seconds from the time, when news was actually published. Also, it can be a problem with availability of the resources to our scrappers, and we often upgrade it. So, this is bad idea to look at this time while you do a processing. Much better is to use meta-post_time
  • domain – is the domain of news resource: www.coindesk.com
  • article label – {‘label’: ‘undefined’, ‘score’: 0.0}. key label can take the following values: news, overview, statistics, undefined (cannot be exactly assigned to one of the classes); score – model prediction score for this class
  • source_lang – source language of the article: en
  • is_breaking_news – check, if the news belongs to the breaking news, or it`s date of publishing on the resource is distant from the current date: True
  • hashtags_list – is the list of hashtags. On the EN crypto resources first hashtag will be #Crypto. On all russian resources first hashtag will be #Russian. And other hashtags selected from a well-defined hashtags table. Hahtags: [’#Crypto’, ‘#ETH’, ‘#Airdrop’, ‘#Million’]
  • fields_tickers – is the market fields and tickers that are in the news. Fields can be: crypto, resources, fx, american, russian, token_sale. Tickers are the stocks or cryptocurrencies from the given area, which are discussed in the news. fields_tickers: {‘crypto’: [‘ETH’]}
  • sentiment – is the sentiment of the news. Can be positive, negative or neutral: positive
  • article_type – type of the news. Can be business, sci_tech, world, sports. There are really few sport news in our data, but sometimes it happens. article_types: sci_tech
  • blockwords – these are mainly political words from a certain prohibited list that are contained in the news. On that basis is decided whether the news is belonging to the financial news-field. blockwords: {‘appropriate’: True, ‘blockwords’: []}
  • similarity – is the semantic search result over last N hours of received news. This field contains list of most similar news. By default, you are receiving only one unique news and no similar news. Possibly, we will add more similar news in this field. It can be useful for building news graph dependencies. There are the next fields: is news unique: True and what’s the score: 0.12002306545576251; field record represents data-EN field in similar article (without similarity field)

Get last 5 economic calendar news

This query returns the last 5 published economic calendar news.

url = "https://cryptoinfo.p.rapidapi.com/api/private/latest_news/economic-calendar-large"

headers = {
	"Content-Type": "application/json",
	"X-RapidAPI-Key": X_RAPIDAPI_KEY,
	"X-RapidAPI-Host": "cryptoinfo.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)
print(response.status_code)

Response description

  • Length of data: 5
  • Single news containing the next fields: dict_keys([‘meta’, ‘data’, ‘lastModified’])
  • Meta information in news: {‘topic’: ‘economic-calendar’, ‘post_time’: ‘2022-08-02 01:31:21+00:00’, ‘event_id’: ‘eventRowId_456130’, ‘hash’: -3296044604172264920}
  • event_id – shows a unique id for the news
  • post_time – is the time when this news was published in our API
  • hash – you can compare different news on hash. Very useful while using API endpoint instead of websocket to validate – if the obtained data is new in your application
  • Time of posting in our API: 2022-08-02 01:31:16+00:00 | 2022-08-02 01:31:21+00:00 | 2022-08-02 01:30:28+00:00 | 2022-08-02 01:31:12+00:00 | 2022-08-02 01:00:42+00:00
  • All time in our data can be decoded with format=%Y-%m-%d %H:%M:%S%z

Describing data field

  • Data field contains supported languages: dict_keys([‘ru’, ‘en’])
  • There are three fields that differ on languages: country, event, link,

en fields:

ru fields:

Other fields we will consider only for en language. There are next keys:

  • dict_keys([‘event_id’, ‘date’, ‘country’, ‘country_key’, ‘country_money’, ‘n_full_stars’, ‘n_total_stars’, ‘event’, ‘link’, ‘actual_text’, ‘forecast_text’, ‘previous_text’, ‘was_notification’, ‘hashtags’, ‘actual_text_symbol’, ‘forecast_text_symbol’, ‘previous_text_symbol’])
  • date – date of the planned release of the news. It differs from the post_time from the meta, which is the actual release of the news. 2022-08-02 01:30:00+00:00
  • country – country name: Australia
  • country_key – key for the country: Australia. May vary by country
  • country_money – country currency: AUD
  • n_full_stars – show how important the news is: 1
  • n_total_stars – shows the maximum importance value: 3
  • event – event name: Invest Housing Finance (MoM)
  • actual_text – actual value of the indicator. actual_text_symbol – unit of measure for the indicator. -6.3%
  • forecast_text – predicted value of the indicator. forecast_text_symbol – unit of measure for the indicator. Сan be empty if no prediction has been made.
  • previous_text – previous value of the indicator. previous_text_symbol – unit of measure for the indicator. 0.9%
  • was_notification – field for internal use. Indicates whether an alert has been published for this event. False
  • hashtags – is the list of hashtags. The first hashtag always matters #Stat. And other hashtags selected from a well-defined hashtags table. Hahtags: [’#Stat’, ‘#MoM’, ‘#Housing’, ‘#Australia’]

Get news over a period of time

Returns a list of news in the specified range. In order to control the consumption of our server and API resources, we have introduced a limit on the amount of data collected in this request - a maximum of 24 hours. If you want to get data for one month, you will have to make 30 requests with a start and end shift.
You can test this request in Python using the following code:

import requests

url = "https://cryptoinfo.p.rapidapi.com/api/private/news_over_a_period_of_time/rapid_api/news"

querystring = {
	"time_start":"2023-01-20 17:34:58+00:00",
	"time_finish":"2023-01-21 19:34:58+00:00"
}

headers = {
	"Content-Type": "application/json",
	"X-RapidAPI-Key": X_RAPIDAPI_KEY,
	"X-RapidAPI-Host": "cryptoinfo.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.status_code)

Request overview

  • Time start and time finish should be in format: %Y-%m-%d %H:%M:%S%z
  • You can set time range between time_start and time_finish and set it to be longer than 24 hours, but retrieved data will contain data for time_start -> time_start + 24h

Response overview

  • Length of result data: 302
  • Post time of first and the last news: 2023-01-21 17:34:11+00:00 2023-01-20 17:35:09+00:00
  • Data retrieval order: from new to old
  • In this example, the last news has publish time two hours earlier than finish time. This is because the maximal delta between the start time and finish time cannot be larger than 24 hours.
  • Each news has format as was described above

Get economic calendar news over a period of time

Returns a list of economic calendar news in the specified range. In order to control the consumption of our server and API resources, we have introduced a limit on the amount of data collected in this request - a maximum of 30 days. If you want to get data for one year, you will have to make 12 requests with a start and end shift.
You can test this request in Python using the following code:

import requests

url = "https://cryptoinfo.p.rapidapi.com/api/private/news_over_a_period_of_time/rapid_api/economic-calendar-large"

querystring = {
	"time_start":"2022-12-20 17:34:58+00:00",
	"time_finish":"2023-02-13 19:34:58+00:00"
}

headers = {
	"Content-Type": "application/json",
	"X-RapidAPI-Key": X_RAPIDAPI_KEY,
	"X-RapidAPI-Host": "cryptoinfo.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.status_code)

Request overview

  • Time start and time finish should be in format: %Y-%m-%d %H:%M:%S%z
  • You can set time range between time_start and time_finish and set it to be longer than 30 days, but retrieved data will contain data for time_start -> time_start + 30d

Response overview

  • Length of result data: 1452
  • Post time of first and the last news: 2023-01-19 17:00:24+00:00 2022-12-20 19:00:29+00:00
  • Data retrieval order: from new to old
  • In this example, the last news has publish time two hours earlier than finish time. This is because the maximal delta between the start time and finish time cannot be larger than 30 days.
  • Each news has format as was described above