TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jbms/finance-dl/llms.txt
Use this file to discover all available pages before exploring further.
finance_dl.gemini scraper retrieves trade history, transfer history, and current balance snapshots from the Gemini cryptocurrency exchange using Gemini’s authenticated REST API. Unlike the browser-based scrapers, this module uses the requests library directly — no Selenium or ChromeDriver is required. Downloads are incremental: the scraper inspects existing files to determine the most recent timestamp already on disk and fetches only newer records.
Configuration Parameters
A dict containing your Gemini API key and secret. These are REST API credentials generated in your Gemini account settings, not your login username and password.
Path to the local directory where downloaded CSV files will be written. The directory will be created if it does not exist.
API Endpoints Used
This scraper communicates with the following Gemini REST API endpoints:| Endpoint | Purpose |
|---|---|
https://api.gemini.com/v1/balances | Fetches current balances for all currencies held |
https://api.gemini.com/v1/mytrades | Fetches trade history, paginated by timestamp |
https://api.gemini.com/v1/transfers | Fetches deposit and withdrawal history |
https://api.gemini.com/v2/ticker/{symbol} | Fetches current bid/ask prices per currency for USD valuation in balance snapshots |
Output Format
All output files are written directly intooutput_directory:
| File pattern | Contents |
|---|---|
trades.<timestamp>.csv | All trades up to and including the millisecond timestamp in the filename |
transfers.<timestamp>.csv | All transfers up to and including the millisecond timestamp in the filename |
balances.YYYY-MM-DD.csv | Balance snapshot taken on the given date, with mid-market USD prices |
trades.*.csv and transfers.*.csv filenames encodes the timestampms of the last record in that file. On the next run, the scraper sorts existing files, reads the most recent timestamp, and requests only records newer than that point. Balance snapshots are written using today’s date and are created fresh on each run.
The Gemini public API allows up to 120 requests per minute. The scraper enforces a minimum interval of 0.5 seconds between requests and retries automatically on HTTP 429 responses, backing off according to the delay indicated by the server.
Getting API Credentials
- Log in to gemini.com and navigate to Settings → API.
- Click Create a New API Key.
- Select the Auditor role (read-only) — full trading permissions are not required for downloading data.
- Copy both the API Key and API Secret immediately; the secret is only shown once.
Configuration Example
This scraper does not use Selenium. You do not need to configure
profile_dir, headless, or ChromeDriver for Gemini.