> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Linking Marketstack as a source Canonical URL: https://posthog.com/docs/data-pipelines/sources/marketstack > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://us.posthog.com` or `https://app.posthog.com` (app host for links). ## On this page - [Prerequisites](#prerequisites) - [Adding a data source](#adding-a-data-source) - [Sync modes](#sync-modes) - [Configuration](#configuration) - [Supported tables](#supported-tables) - [Troubleshooting](#troubleshooting) **Beta release** This source is currently in **beta**. It works end to end, but you may still hit rough edges. [Let us know](https://us.posthog.com/#panel=support%3Asupport%3Adata_warehouse%3A%3Atrue) if you do. ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_9608fcca70) ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_dark_a92b0e022d) Let AI connect your sources for you Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog. `npx @posthog/wizard warehouse` ![PostHog Wizard hedgehog](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png) ![](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png)Let AI connect your sources for you [Marketstack](https://marketstack.com) (an APILayer product) is a REST API for real-time, intraday, and historical stock market data covering 70+ exchanges and 125,000+ tickers. Linking Marketstack as a source pulls end-of-day, intraday, splits, and dividends data, company profiles, analyst ratings, and SEC filings along with market reference tables (tickers, exchanges, currencies, timezones) into your PostHog data warehouse, where you can join it with your product data. ## Prerequisites Before connecting Marketstack, you need: - A [Marketstack account](https://marketstack.com/signup). - Your API **access key**, found in your [Marketstack dashboard](https://marketstack.com/dashboard). The free plan covers end-of-day and all reference tables; intraday data requires a paid plan. ## Adding a data source 1. In PostHog, go to the [Sources tab](https://app.posthog.com/data-management/sources) of the data pipeline section. 2. Click **\+ New source** and click **Link** next to this source. 3. Enter your credentials (see [Configuration](#configuration) below) and click **Next**. 4. Select the tables you want to sync, choose a sync method and frequency, then click **Import**. Once the syncs are complete, you can start querying this data in PostHog. When configuring the source, provide: - **Access key** - your Marketstack API access key from the [dashboard](https://marketstack.com/dashboard). - **Symbols** (optional) - a comma-separated list of ticker symbols, e.g. `AAPL,MSFT,TSLA`. Symbols are **required** for the EOD, intraday, splits, dividends, ticker info, and company ratings tables — those endpoints return data per symbol. The reference tables (tickers, exchanges, currencies, timezones) don't need symbols. - **CIK codes** (optional) - a comma-separated list of SEC Central Index Key codes, e.g. `0000320193`. CIK codes are **required** for the submissions table. The `tickerinfo`, `companyratings`, and `submissions` tables are only available on Marketstack API v2. The `companyratings` endpoint allows one request per minute, so each symbol adds about a minute to its sync. Marketstack enforces a rate limit of 5 requests per second and a monthly request quota tied to your plan, so keep the number of symbols and the historical range in mind when backfilling. ## Sync modes Each table can be synced in one of several modes, depending on what the source supports: - **Webhook** (when available) – the source pushes changes to PostHog in real time. Fastest freshness, lowest ongoing cost, and the only mode that reliably captures updates and deletes. - **Incremental** – only new or updated rows are synced on each run, using a cursor field (such as an `updated_at` timestamp). Cheaper than a full refresh, but deletes aren't captured. - **Append only** – new rows are appended using a cursor field; existing rows are never updated. Ideal for immutable, append-only tables like event logs. - **Full refresh** – the whole table is reloaded on every sync. Use it when a table has no reliable cursor or when you need deletions reflected. See [sync methods](https://posthog.com/docs/data-pipelines/sources.md#sync-methods) for a full explanation of how each mode works and how to choose between them. The time-series tables (`eod`, `intraday`, `splits`, `dividends`) support incremental sync — after the first backfill, each run only requests data on or after the latest synced `date`, using Marketstack's `date_from` filter. The reference and lookup tables (`tickers`, `exchanges`, `currencies`, `timezones`, `tickerinfo`, `companyratings`, `submissions`) are full-refresh snapshots. ## Configuration | Option | Type | Required | | --- | --- | --- | | `Access key` | password | Yes | | `Symbols` | text | No | | `CIK codes` | text | No | ## Supported tables | Table | Description | Sync method | Incremental field | Primary key | | --- | --- | --- | --- | --- | | `eod` | End-of-day (daily OHLCV) stock prices per symbol, including adjusted prices, split factor, and dividend. Requires symbols. Incremental on date. | Incremental, Full refresh | date | — | | `intraday` | Intraday (intra-day interval) stock prices per symbol. Requires symbols and a paid plan. Incremental on date. | Incremental, Full refresh | date | — | | `splits` | Historical stock split factors per symbol. Requires symbols. Incremental on date. | Incremental, Full refresh | date | — | | `dividends` | Historical dividend payouts per symbol. Requires symbols. Incremental on date. | Incremental, Full refresh | date | — | | `tickerinfo` | Company profile per configured symbol: sector, industry, executives, addresses, and listing exchanges. Requires symbols. Full refresh. | Full refresh | — | — | | `companyratings` | Individual analyst ratings and price targets per configured symbol. Requires symbols. Rate-limited by Marketstack to one request per minute, so each symbol adds a minute to the sync. Full refresh. | Full refresh | — | — | | `submissions` | Recent SEC filings (10-K, 10-Q, 8-K, and others) per configured CIK code, one row per filing. Requires CIK codes. Full refresh. | Full refresh | — | — | | `tickers` | Reference table of supported stock tickers with name, exchange, and EOD/intraday availability. Full refresh. | Full refresh | — | — | | `exchanges` | Reference table of supported stock exchanges with MIC/acronym codes, country, and timezone. Full refresh. | Full refresh | — | — | | `currencies` | Reference table of supported currencies with ISO code, symbol, and name. Full refresh. | Full refresh | — | — | | `timezones` | Reference table of supported timezones with abbreviation and daylight-saving abbreviation. Full refresh. | Full refresh | — | — | ## Troubleshooting - **`missing_symbols` / no rows for EOD, intraday, splits, dividends, ticker info, or company ratings** - these tables require at least one symbol. Add symbols to the source configuration and resync. - **`missing_cik_codes`** - the submissions table requires at least one CIK code. Add CIK codes to the source configuration and resync. - **`function_access_restricted`** - your Marketstack plan doesn't include this endpoint (intraday requires a paid plan). Upgrade your plan or deselect the restricted table. - **`usage_limit_reached`** - you've hit your monthly request quota. Upgrade your plan or wait for the quota to reset, then resync. - **`invalid_access_key`** - the access key is wrong or deactivated. Generate a new key in your Marketstack dashboard and reconnect. If your sync is failing or data looks wrong, see the [Data warehouse troubleshooting guide](https://posthog.com/docs/data-warehouse/troubleshooting.md). If that doesn't help, [contact support](https://us.posthog.com/#panel=support%3Asupport%3Adata_warehouse%3A%3Atrue) – we're happy to help.