<jupyter_start><jupyter_text>https://docs.defipulse.com/overview-of-api-endpointshttps://data-beta.defipulse.com/dashboard/egshttps://docs.defipulse.com/api-docs-by-provider/defi-pulse-data/total-value-locked/total-value-locked<jupyter_code>import pandas as pd
import requests
import json 
from datetime import datetime
TVL_Lending = requests.get('https://data-api.defipulse.com/api/v1/defipulse/api/GetHistory?resolution=history&project=all&category=lending&api-key=<KEY>')
TVL_Lending = TVL_Lending.json()
TVL_Lending =pd.DataFrame(TVL_Lending)
TVL_Lending.head()<jupyter_output><empty_output><jupyter_text><jupyter_code>TVL_Lending['Category']='Lending'
TVL_Lending.head()
import requests
import json 
Lending = requests.get('https://data-api.defipulse.com/api/v1/defipulse/api/getLendingHistory?resolution=history&api-key=<KEY>')
Lending = Lending.json()
Lending =pd.DataFrame(Lending)<jupyter_output><empty_output><jupyter_text>https://blog.csdn.net/weixin_39750084/article/details/81429037 https://www.geeksforgeeks.org/python-convert-list-of-nested-dictionary-into-pandas-dataframe/<jupyter_code>Lending.head()
lend_rates = Lending['lend_rates'].to_list()
lend_rates=pd.DataFrame(lend_rates)
lend_rates['timestamp']=Lending['timestamp']
lend_rates.head()
borrow_rates = Lending['borrow_rates'].to_list()
borrow_rates=pd.DataFrame(borrow_rates)
borrow_rates['timestamp']=Lending['timestamp']
borrow_rates.head()
interest_speed = Lending['interest_speed'].to_list()
interest_speed=pd.DataFrame(borrow_rates)
interest_speed['timestamp']=interest_speed['timestamp']
interest_speed.head()
outstanding = Lending['outstanding'].to_list()
outstanding=pd.DataFrame(borrow_rates)
outstanding['timestamp']=Lending['timestamp']
outstanding.head()
import requests
import json 
from datetime import datetime
Compound_TVL = requests.get('https://data-api.defipulse.com/api/v1/defipulse/api/GetHistory?resolution=history&project=compound&api-key=<KEY>')
Compound_TVL = Compound_TVL.json()
Compound_TVL =pd.DataFrame(Compound_TVL)
Compound_TVL.head()
Compound_TVL['project']='Compound'
Compound_TVL.head()
import requests
import json 
from datetime import datetime
aave_TVL = requests.get('https://data-api.defipulse.com/api/v1/defipulse/api/GetHistory?resolution=history&project=aave&api-key=<KEY>')
aave_TVL = aave_TVL.json()
aave_TVL =pd.DataFrame(aave_TVL)
aave_TVL.head()
Compound_TVL['project']='aave'
Compound_TVL.head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14671025745811198, 'fraction_numerical': 0.008173273395995096, 'mean_word_length': 9.643478260869566, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 9, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '167278', 'license': 'MIT', 'n_tokens_mistral': 936, 'n_tokens_neox': 902, 'n_words': 85, 'path': 'DeFi_Data.ipynb', 'repo_name': 'duke-sunshine/Algorithmic-Trading', 'size': '2667'}