Runnable notebook: analyzing the secondary market
The code-track companion to the ALT/FNDATA academic program. It walks through the same nine tasks as the no-code sandbox track, but in Python, so students can see how the dataset connects to pandas and the production REST API. The notebook runs end to end with no API key using a small synthetic sample built into the setup cell, then switches to live data the moment an instructor adds a shared class key.
Download the notebook (.ipynb)
A .ipynb file opens as raw JSON in a web browser, which is not meant to be read directly. Download it with the button above, then open it in Jupyter, JupyterLab, VS Code, or Google Colab to run it.
What the notebook covers
- Setup. The reusable client and the raw REST query shape, plus a clearly labeled synthetic sample so every cell runs even without a key.
- 1. Discovery: tables and schema. Listing tables and reading a table's columns before you query (GET /v1/tables and GET /v1/tables/{name}/schema).
- 2. Your first query. Pulling recent lots with a small set of documented fields.
- 3. Filter by brand and date range. Combining an exact brand match with a date window.
- 4. Pricing power. The median of realized price over the high estimate across sold lots, a stable demand measure.
- 5. Sell-through. The share of offered lots that sold, computed with pandas.
- 6. Demand over time. Bucketing a brand's cleared prices by quarter to build a teaching demand index, with the recency caveat stated plainly.
- 7. Brand to ticker. Rolling a listed group's lots up through the stock_ticker mapping.
- 8. Text search. Case-insensitive substring matching inside item_title with the like operator.
- 9. Load into pandas and export to CSV. Turning a pull into a DataFrame, computing both headline measures, and writing a CSV.
- Where to go next. A pointer to the capstone brief.
How to run it
- Download the notebook with the button above.
- Open it in Jupyter, JupyterLab, VS Code, or Google Colab.
- Run the cells from top to bottom. With no key set, the notebook runs in offline sample mode on synthetic data that matches the real schema, so you can practice the mechanics.
- To use live data, set the
ALTFNDATA_API_KEYenvironment variable (or paste the key into the setup cell) to a shared class key from your instructor, then re-run. Every example works the same way in both modes.
What you need
- Python 3.9 or newer, with
pandasandrequestsinstalled (pip install pandas requests). - Optional: the reusable client
altfndata_client.pyfrom the documentation at docs.altfndata.com, placed next to the notebook. - Optional: a shared class API key. Students do most coursework in the no-code sandbox at sandbox.altfndata.com, which needs no key; an instructor can request a single class key for the code track.
Access and data reality
Keys for the production API are issued manually by the ALT/FNDATA team on request, so students normally work in the sandbox and use this notebook in offline sample mode until a class key is available. The dataset also has a known recency under-ingestion caveat: the newest quarters are still being backfilled, so a fall-off in recent cleared-price totals reflects coverage rather than the market cooling. Every example rests on stable measures such as pricing power, sell-through, counts, and medians, and the quarterly demand index is a lesson in method, not a claim about appreciation.
Questions
For a class API key or any question, write to info@altfndata.com. Documentation and the reusable client live at docs.altfndata.com.