Cкрипт на Python для криптобіржі LBank
23 USDНеобхідно написати простий скрипт на Python який буде виводити в терміналі кожну секунду ціну Bid і Ask по Фючерсу вказанної монети на криптобіржі LBank. (На початку крипту необхідно запитувати введення тікеру монети).
Приклад коду для біржі OKX:
import requests
import time
import logging
# Настройка логгера
logging.basicConfig(
filename='okx_futures_price.log',
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)
# Ввод тикера от пользователя
symbol = input("Введите тикер фьючерсного контракта (например, BTC-USDT-SWAP): ").strip().upper()
url_template = "https://www.okx.com/api/v5/market/ticker?instId={}"
def get_bid_ask(symbol):
url = url_template.format(symbol)
try:
response = requests.get(url, timeout=5)
response.raise_for_status()
data = response.json()
if data.get("code") != "0":
raise ValueError(f"Ошибка в данных: {data.get('msg')}")
ticker = data["data"][0]
bid = ticker["bidPx"]
ask = ticker["askPx"]
logging.info(f"BID: {bid} | ASK: {ask}")
print(f"BID: {bid} | ASK: {ask}")
except Exception as e:
error_msg = f"Ошибка при получении данных: {e}"
logging.error(error_msg)
print(error_msg)
def main():
print(f"Получение цен для контракта {symbol} на OKX. Нажмите Ctrl+C для выхода.")
while True:
get_bid_ask(symbol)
time.sleep(1)
if __name__ == "__main__":
main()
Client's review of cooperation with Mikola S.
Cкрипт на Python для криптобіржі LBankThe task was completed quickly and very efficiently! I recommend!
Freelancer's review of cooperation with Oleksandr Skripar
Cкрипт на Python для криптобіржі LBankThe client was always in touch, the collaboration went great. I recommend!
-
1970 45 3 1 Ready to start working, I will write the necessary functions in Python.
I will do everything qualitatively, conduct tests, and collect data.
I will be glad to cooperate with you.
-
3142 11 0 Доброго часу доби!
Розробляю на Python!
Скріпт вже зробив:
Отладка - Ответ API: {
"result": "true",
"msg": "Success",
"data": {
"symbol": "eth_usdt",
"askPrice": "1804.21",
… "askQty": "29.704",
"bidQty": "54.5665",
"bidPrice": "1804.2"
},
"error_code": 0,
"ts": 1746007542624
}
Время: 13:05:43 | eth_usdt | Bid: 1804.2 | Ask: 1804.21
Время: 13:05:45 | eth_usdt | Bid: 1804.2 | Ask: 1804.21
Время: 13:05:46 | eth_usdt | Bid: 1804.2 | Ask: 1804.21
Время: 13:05:48 | eth_usdt | Bid: 1804.2 | Ask: 1804.21
Время: 13:05:49 | eth_usdt | Bid: 1804.2 | Ask: 1804.21
Время: 13:11:50 | eth_usdt | Bid: 1805.93 | Ask: 1805.94
Время: 13:11:51 | eth_usdt | Bid: 1805.93 | Ask: 1805.94
Время: 13:11:53 | eth_usdt | Bid: 1805.93 | Ask: 1805.94
Время: 13:11:54 | eth_usdt | Bid: 1805.93 | Ask: 1805.94
Время: 13:11:56 | eth_usdt | Bid: 1806.13 | Ask: 1806.14
Время: 13:11:57 | eth_usdt | Bid: 1806.39 | Ask: 1806.4
Время: 13:11:59 | eth_usdt | Bid: 1806.39 | Ask: 1806.4
Время: 13:12:00 | eth_usdt | Bid: 1806.39 | Ask: 1806.4
Ось результат виводу, готовий віддати.
-
1317 23 0 Good day! I am ready to write such a script. Let's get in touch and discuss the details.
-
1558 37 3 1 Good day, I will implement in Python. I have had similar experience before. I will be happy to cooperate!
-
4417 32 0 Good afternoon, Alexander.
I am ready to undertake your project. I have experience with many exchanges such as Binance, ByBit, Huobi, OKX, Gate.io, Poloniex, etc., including obtaining data via API requests and websockets, as well as calculating technical analysis indicators across different timeframes, blockchain transaction parsers, scripts for intraday and inter-exchange trading, and much more.
I can clarify the price and deadlines after a more detailed discussion of the project, as I have a number of questions about it.
I would be glad to cooperate!
Best regards, Alexander.
-
726 9 1 Good afternoon! I have carefully studied your project and am ready to start its implementation. Let's discuss the details for the best execution.
Current freelance projects in the category Python
Multifunctional HTML template for a betting website and parsing match API (
25 USD
I have a Sportsbook API, I need to download a template for an online betting website from the internet and integrate match parsing and a payment system into it) the task is very simple, write who can do it right away) essentially, I need a basic website for testing with a… PHP, Python ∙ 10 hours 40 minutes back ∙ 13 proposals |
Create a bot in Telegram (seller's cabinet)
16 USD
Hello everyone I need a user personal account in the format of a bot in Telegram After launching and completing the survey, a personal account is created for the user (which allows them to access the system for further buttons) so that each registered user is displayed in a… Python, Bot Development ∙ 1 day 13 hours back ∙ 93 proposals |
Find a product feed (Google Merchant XML) for a website on OpenCart
16 USD
It is necessary to find a direct link to the active product feed (XML) of a competitor for Google Merchant Center Platform (CMS): OpenCart / ocStore Find the original feedRequirements for the result: Working link to the XML file Python, Data Parsing ∙ 1 day 23 hours back ∙ 21 proposals |
Development of a TikTok farm (content factory)It is necessary to develop a system for centralized management of multiple TikTok accounts with automatic content publishing, using individual proxies and simulating natural account activity. Functional Requirements1. Account Management Adding and removing TikTok accounts.… Python, Bot Development ∙ 2 days 10 hours back ∙ 19 proposals |
Improve the performance of Claude Code and work on software development.I am currently developing CRM and Analytics software. I am using Claude Code, but I understand that the results are not the best in terms of changes. There are 2 tasks - Need help creating a preset for skills, MD, and so on to improve quality. Take verified ones that have been… AI & Machine Learning, Python ∙ 2 days 17 hours back ∙ 24 proposals |