{ "cells": [ { "cell_type": "code", "execution_count": 32, "id": "68966247", "metadata": {}, "outputs": [], "source": [ "import requests\n", "import pandas as pd\n", "import numpy as np\n", "import json\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": null, "id": "02cd5305", "metadata": {}, "outputs": [], "source": [ "### Extended Trades History ###\n", "candleType = 'trades'\n", "market = 'ETH-USD'\n", "params = {\n", " 'interval': \"1m\",\n", " 'limit': 100,\n", "}\n", "r = requests.get(f'https://api.starknet.extended.exchange/api/v1/info/candles/{market}/{candleType}', params=params)" ] }, { "cell_type": "code", "execution_count": 33, "id": "5603b04d", "metadata": {}, "outputs": [], "source": [ "### Aster Trades History ###\n", "params = {\n", " 'symbol': \"ETHUSDT\",\n", " 'limit': 1000,\n", "}\n", "r = requests.get('https://fapi.asterdex.com/fapi/v3/trades', params=params)" ] }, { "cell_type": "code", "execution_count": 34, "id": "a3ad1819", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idpriceqtyquoteQtytimeisBuyerMaker
0745065472311.020.044101.682026-04-27 14:22:45.650True
1745065482311.000.0049.242026-04-27 14:22:45.650True
2745065492310.910.0036.932026-04-27 14:22:45.650True
3745065502310.900.0049.242026-04-27 14:22:45.650True
4745065512310.800.0049.242026-04-27 14:22:45.700True
.....................
995745075422312.100.0049.242026-04-27 14:34:12.500True
996745075432312.182.4425646.342026-04-27 14:34:13.443True
997745075442312.2410.09923351.312026-04-27 14:34:13.600True
998745075452312.133.1207213.842026-04-27 14:34:14.568True
999745075462312.196.22814400.312026-04-27 14:34:15.988True
\n", "

1000 rows × 6 columns

\n", "
" ], "text/plain": [ " id price qty quoteQty time isBuyerMaker\n", "0 74506547 2311.02 0.044 101.68 2026-04-27 14:22:45.650 True\n", "1 74506548 2311.00 0.004 9.24 2026-04-27 14:22:45.650 True\n", "2 74506549 2310.91 0.003 6.93 2026-04-27 14:22:45.650 True\n", "3 74506550 2310.90 0.004 9.24 2026-04-27 14:22:45.650 True\n", "4 74506551 2310.80 0.004 9.24 2026-04-27 14:22:45.700 True\n", ".. ... ... ... ... ... ...\n", "995 74507542 2312.10 0.004 9.24 2026-04-27 14:34:12.500 True\n", "996 74507543 2312.18 2.442 5646.34 2026-04-27 14:34:13.443 True\n", "997 74507544 2312.24 10.099 23351.31 2026-04-27 14:34:13.600 True\n", "998 74507545 2312.13 3.120 7213.84 2026-04-27 14:34:14.568 True\n", "999 74507546 2312.19 6.228 14400.31 2026-04-27 14:34:15.988 True\n", "\n", "[1000 rows x 6 columns]" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l = json.loads(r.text)\n", "df = pd.DataFrame(l)\n", "df['time'] = pd.to_datetime(df['time'], unit='ms')\n", "df" ] }, { "cell_type": "code", "execution_count": null, "id": "3c908942", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "60f4608a", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "76624896", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "5ade3c15", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "py_313", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.13" } }, "nbformat": 4, "nbformat_minor": 5 }