mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-02 23:41:27 +00:00
* bump * Initial function write * Delete this line from yaml * Changed all the main things - Need help on tests * pylint errors * Tests v0 * Tests v1 * Tests v2 --------- Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com>
38 lines
949 B
Markdown
Vendored
38 lines
949 B
Markdown
Vendored
## Update list of coins
|
|
|
|
### Coingecko
|
|
|
|
- File: `/data/coingecko_coins.json`
|
|
- Endpoint: [https://api.coingecko.com/api/v3/coins/list](https://api.coingecko.com/api/v3/coins/list)
|
|
|
|
- File: `/data/coingecko_categories.json`
|
|
- Endpoint: [https://api.coingecko.com/api/v3/coins/list](https://api.coingecko.com/api/v3/coins/list)
|
|
- Code:
|
|
|
|
```python
|
|
new_categories = {}
|
|
for category in categories:
|
|
new_categories[category['category_id']] = category['name']
|
|
```
|
|
|
|
### Coinpaprika
|
|
|
|
- File: `/data/coinpaprika_coins.json`
|
|
- Endpoint: [https://api.coinpaprika.com/v1/coins](https://api.coinpaprika.com/v1/coins)
|
|
|
|
### Defillama
|
|
|
|
- File: `/data/defillama_dapps.json`
|
|
- Endpoint: [https://api.llama.fi/protocols](https://api.llama.fi/protocols)
|
|
|
|
```python
|
|
import request
|
|
API_URL = "https://api.llama.fi"
|
|
url = f"{API_URL}/protocols"
|
|
r = request(url)
|
|
data = r.json()
|
|
protocols = {}
|
|
for protocol in data:
|
|
protocols[protocol['slug']] = protocol['name']
|
|
```
|