series_idstring必填
The id for a series. string, required
https://api.sandbase.ai/v1/api/fred/series-observationsGet Series Observations from FRED. Returns the official FRED API response unchanged.
您的输出将显示在这里
完成输入,然后点击运行。
Returns the observations (date and value pairs) for one FRED data series. It needs a series_id, such as GNPCA, and can filter by date range, change the units, or aggregate to a lower frequency.
GNPCA to chart it or load it into a spreadsheet.units such as pch or pc1 to get percent changes without calculating them yourself.frequency and aggregation_method.vintage_dates or realtime_start and realtime_end to test models on the data known at that time.curl -X POST "https://api.sandbase.ai/v1/api/fred/series-observations" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"series_id": "GNPCA", "file_type": "json"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
series_id | string | Yes | The id for a series. string, required |
aggregation_method | string | No | A key that indicates the aggregation method used for frequency aggregation. This parameter has no affect if the frequency parameter is not set. string, optional, default: avg One of the following values: 'avg', 'sum', 'e |
file_type | string | No | Response format. Only json is supported. |
frequency | string | No | An optional parameter that indicates a lower frequency to aggregate values to. The FRED frequency aggregation feature converts higher frequency data series into lower frequency data series (e.g. converts a monthly data s |
limit | integer | No | The maximum number of results to return. integer between 1 and 100000, optional, default: 100000 |
observation_end | string | No | The end of the observation period. YYYY-MM-DD formatted string, optional, default: 9999-12-31 (latest available) |
observation_start | string | No | The start of the observation period. YYYY-MM-DD formatted string, optional, default: 1776-07-04 (earliest available) |
offset | integer | No | non-negative integer, optional, default: 0 |
output_type | integer | No | An integer that indicates an output type. integer, optional, default: 1 One of the following values: '1', '2', '3', '4' 1 = Observations by Real-Time Period 2 = Observations by Vintage Date, All Observations 3 = Observat |
realtime_end | string | No | The end of the real-time period. For more information, see Real-Time Periods , vintage_dates . YYYY-MM-DD formatted string, optional, default: today's date |
realtime_start | string | No | The start of the real-time period. For more information, see Real-Time Periods , vintage_dates . YYYY-MM-DD formatted string, optional, default: today's date |
sort_order | string | No | Sort results is ascending or descending observation_date order. One of the following strings: 'asc', 'desc'. optional, default: asc |
units | string | No | A key that indicates a data value transformation. string, optional, default: lin (No transformation) One of the following values: 'lin', 'chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log' lin = Levels (No transformat |
vintage_dates | string | No | A comma separated string of YYYY-MM-DD formatted dates in history (e.g. 2000-01-01,2005-02-24). Vintage dates are used to download data as it existed on these specified dates in history. Vintage dates can be specified in |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"count": 97,
"file_type": "json",
"limit": 100000,
"observation_end": "9999-12-31",
"observation_start": "1776-07-04",
"observations": [
{
"date": "1929-01-01",
"realtime_end": "2026-10-30",
"realtime_start": "2026-10-30",
"value": "1202.659"
}
],
"offset": 0,
"order_by": "observation_date",
"output_type": 1,
"realtime_end": "2026-10-30",
"realtime_start": "2026-10-30",
"sort_order": "asc"
}
| Field | Meaning |
|---|---|
count | Total number of observations that match the request. In the example it is 97. |
observations[].date | Date of the observation in YYYY-MM-DD format. For this annual series each date is January 1 of a year. |
observations[].value | Value of the observation as a string. Convert it to a number before you calculate with it. |
observations[].realtime_start / observations[].realtime_end | Start and end of the real-time period in which this value was the current one. Both are YYYY-MM-DD dates. |
observation_start / observation_end | Observation date range used for the request. The defaults 1776-07-04 and 9999-12-31 mean no limit. |
units | Transformation applied to the values. lin means levels with no transformation. |
sort_order / order_by | Sort direction and the field used to sort the observations. The example uses asc and observation_date. |
limit / offset | Page size and starting position used for this response. Use them to page through long series. |
output_type | Output type used for the response. The example uses 1, which is observations by real-time period. |
series_id is required. To find an ID, use FRED Search Series.limit (1 to 100000) and offset. Compare offset plus the number of returned rows with count to know when to stop.$0.00001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
开始构建
具备统一身份验证和使用情况跟踪的平台 API 端点。
curl -X POST "https://api.sandbase.ai/v1/api/fred/series-observations" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"limit": 100000,
"units": "lin",
"offset": 0,
"file_type": "json",
"series_id": "GNPCA",
"sort_order": "asc",
"output_type": 1,
"observation_end": "9999-12-31",
"observation_start": "1776-07-04",
"aggregation_method": "avg"
}'将您的 SandBase API 密钥设置到服务器环境中。请求使用 Bearer 身份验证。
export SANDBASE_API_KEY="YOUR_API_KEY"请将密钥保存在服务器端。不要在浏览器代码中暴露它。
series_idstring必填The id for a series. string, required
aggregation_methodstringA key that indicates the aggregation method used for frequency aggregation. This parameter has no affect if the frequency parameter is not set. string, optional, default: avg One of the following values: 'avg', 'sum', 'eop' avg = Average sum = Sum eop = End of Period avg = Average sum = Sum eop = En
默认值:"avg"
可选值:avg, sum, eop
file_typestringResponse format. Only json is supported.
默认值:"json"
可选值:json
frequencystringAn optional parameter that indicates a lower frequency to aggregate values to. The FRED frequency aggregation feature converts higher frequency data series into lower frequency data series (e.g. converts a monthly data series into an annual data series). In FRED, the highest frequency data is daily,
可选值:d, w, bw, m, q, sa, a, wef, weth, wew, wetu, wem, wesu, wesa, bwew, bwem
limitintegerThe maximum number of results to return. integer between 1 and 100000, optional, default: 100000
默认值:100000
observation_endstringThe end of the observation period. YYYY-MM-DD formatted string, optional, default: 9999-12-31 (latest available)
默认值:"9999-12-31"
observation_startstringThe start of the observation period. YYYY-MM-DD formatted string, optional, default: 1776-07-04 (earliest available)
默认值:"1776-07-04"
offsetintegernon-negative integer, optional, default: 0
默认值:0
output_typeintegerAn integer that indicates an output type. integer, optional, default: 1 One of the following values: '1', '2', '3', '4' 1 = Observations by Real-Time Period 2 = Observations by Vintage Date, All Observations 3 = Observations by Vintage Date, New and Revised Observations Only 4 = Observations, Initia
默认值:1
可选值:1, 2, 3, 4
realtime_endstringThe end of the real-time period. For more information, see Real-Time Periods , vintage_dates . YYYY-MM-DD formatted string, optional, default: today's date
realtime_startstringThe start of the real-time period. For more information, see Real-Time Periods , vintage_dates . YYYY-MM-DD formatted string, optional, default: today's date
sort_orderstringSort results is ascending or descending observation_date order. One of the following strings: 'asc', 'desc'. optional, default: asc
默认值:"asc"
可选值:asc, desc
unitsstringA key that indicates a data value transformation. string, optional, default: lin (No transformation) One of the following values: 'lin', 'chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log' lin = Levels (No transformation) chg = Change ch1 = Change from Year Ago pch = Percent Change pc1 = Percent
默认值:"lin"
可选值:lin, chg, ch1, pch, pc1, pca, cch, cca, log
vintage_datesstringA comma separated string of YYYY-MM-DD formatted dates in history (e.g. 2000-01-01,2005-02-24). Vintage dates are used to download data as it existed on these specified dates in history. Vintage dates can be specified instead of a real-time period using realtime_start and realtime_end. Sometimes it
这是该 API 保存的示例响应;查看时不会发起实时请求。
尚未发布已保存的响应。请在 Playground 中运行 API 以查看其响应。
探索更多
| API | 价格 | 响应 |
|---|---|---|
FRED | $0.00001 每次调用 | JSON |
FRED | $0.00001 每次调用 | JSON |
FRED | $0.00001 每次调用 | JSON |
FRED | $0.00001 每次调用 | JSON |
FRED | $0.00001 每次调用 | JSON |
FRED | $0.00001 每次调用 | JSON |
问题
向 https://api.sandbase.ai/v1/api/fred/series-observations 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。
每次调用 $0.00001。每个组织在每个 UTC 日可获得 100 次免费调用,适用于包括此接口在内的所有符合条件的 SandBase APIs;超过后,每次调用将按此价格从您的 SandBase 余额中扣费。无需订阅。
必填:series_id (string)。 可选:aggregation_method(avg, sum, eop 之一), file_type(json 之一), frequency(d, w, bw, m, q, sa, a, wef, weth, wew, wetu, wem, wesu, wesa, bwew, bwem 之一), limit (integer), observation_end (string) 和 observation_start (string) 以及另外 7 项。 Parameters 表和本页的 Playground 列出了每个字段。
在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。
不需要。FRED Get Series Observations 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 FRED API 访问权限。