The official documentation for Market Data — covering the REST API, SDKs, and Google Sheets Add-On. Built with Docusaurus 3.
Production: www.marketdata.app/docs/ Staging: www-staging.marketdata.app/docs/
| Section | Path | Description |
|---|---|---|
| API | /api |
REST API reference — stocks, options, indices, funds, markets, and utilities |
| SDKs | /sdk |
Client libraries for Go, Python, and PHP |
| Sheets Add-On | /sheets |
Google Sheets Add-On documentation |
| Accounts & Billing | /account |
Account management, plans, billing, and entitlements |
yarn # Install dependencies
yarn start # Start dev server at localhost:3000
yarn build # Production buildThe site is hosted on Cloudflare Pages with a Cloudflare Worker reverse proxy. Both production and staging use the same /docs/ base path — routing is determined by hostname, not path prefix. Deployment is handled by a separate orchestrator repo (MarketDataApp/www-marketdata-app) that merges build artifacts from R2 and deploys to unified Pages projects.
Browser → Cloudflare DNS → Worker (hostname lookup) → Cloudflare Pages → Response
- DNS resolves the hostname (both are proxied CNAMEs in Cloudflare)
- Cloudflare routes
/docsand/docs/*to the Worker (viawrangler.tomlroute patterns) - Worker looks up the hostname in a
TARGETSmap to find the Pages deployment target - Worker rewrites the hostname and fetches from Pages (e.g.
www-marketdata-app.pages.dev/docs/api/stocks) - Pages serves the file from its
docs/directory (built and nested there by CI) - Worker returns the response — the URL path stays the same throughout
| Environment | Hostname | Pages Project | Git Branch |
|---|---|---|---|
| Production | www.marketdata.app |
www-marketdata-app |
main |
| Staging | www-staging.marketdata.app |
www-staging-marketdata-app |
staging |
The Worker (worker/handler.js) handles more than just proxying:
- Markdown serving — Requests with
.mdextension orAccept: text/markdownheader return cleaned markdown fetched from the raw GitHub source (frontmatter and JSX stripped) - SDK PHP redirect —
/docs/sdk-php/*redirects to GitHub Pages (301) - Edge caching — Subrequests use
cf.cacheEverything - 404 logging — Logs pathname and referer for missing pages
- Non-docs paths pass through to the origin (WordPress)
Deployment is fully automated via GitHub Actions across two repos:
- This repo (
.github/workflows/deploy-docs.yml) — builds Docusaurus, uploads to R2, triggers orchestrator - Orchestrator (
MarketDataApp/www-marketdata-app) — downloads all sources from R2, merges into unified build, deploys to CF Pages, runs post-deploy tests
Push to staging/main → Build → Upload to R2 → Trigger orchestrator → Deploy to CF Pages → Tests
Workflow:
- Push to
staging— builds and deploys to staging - Verify changes at
www-staging.marketdata.app/docs/ - Open a PR from
staging→mainand merge — deploys to production
If files in worker/ changed, the docs CI also runs worker tests and deploys the Worker.
# Worker unit tests
cd worker && yarn test
# Integration tests (markdown serving against live site)
cd worker && TEST_ENV=staging yarn test:integration
# E2E tests (Playwright — Context7 widget)
TEST_ENV=staging yarn test:e2eapi/ # API reference docs (MDX)
sdk/ # SDK docs — Go, Python, PHP (MDX)
sheets/ # Google Sheets Add-On docs (MDX)
account/ # Account & billing docs (MDX)
src/
theme/ # Swizzled Docusaurus theme components
css/ # Custom styles
worker/ # Cloudflare Worker reverse proxy
e2e/ # Playwright end-to-end tests
.github/workflows # CI/CD pipeline
Search is powered by Algolia DocSearch. The crawler configuration is managed in the Algolia dashboard, not in this repository.
MIT