It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
import json
import math
import time
import random
import requests
def round_up_to_decimals(number, decimals):
factor = 10 ** decimals
rounded_number = math.ceil(number * factor) / factor
return rounded_number
def get_tx(txid):
time.sleep(0.01)
tx = None
try:
url = ""
if networkname=="bitcoin":
url = "https://mempool.space/api/tx/" + txid
elif networkname=="testnet":
url = "https://mempool.space/testnet/api/tx/" + txid
else:
print("Unknow network")
exit()
response = requests.get(url)
if response.status_code == 200:
tx = response.json()
return tx
except Exception as e:
print(f"An error occurred: {e}")
return tx
def get_mempool_txids():
time.sleep(0.05)
txids = []
try:
url = ""
if networkname=="bitcoin":
url = "https://mempool.space/api/mempool/txids"
elif networkname=="testnet":
url = "https://mempool.space/testnet/api/mempool/txids"
else:
print("Unknow network")
exit()
response = requests.get(url)
if response.status_code == 200:
txids = response.json()
return txids
except Exception as e:
print(f"An error occurred: {e}")
return txids
networkname = "bitcoin"
txids = get_mempool_txids()
#with open("txids.txt", "w") as file:
# file.writelines("%s\n" % txid for txid in txids)
for txid in txids:
tx_data = get_tx(txid)
#do something
getrawmempool
bitcoin-cli getrawmempool | jq -s '.[] | select(.txid | startswith("0")) | sort_by(.time) | reverse'