Skip to content

Custom Bars API document request example bug #922

@innichang

Description

@innichang

I AM NOT SURE IF THIS IS THE CORRECT PLACE TO POST THIS!

Describe the bug
https://polygon.io/docs/rest/stocks/aggregates/custom-bars

I was testing out the API to see if this is usable in my service and i noticed this problem:

https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/2023-01-09/2023-02-10?adjusted=true&sort=asc&limit=120&apiKey={YOUR_API_KEY}

the date range is set to a range + 2 years from current time(2025-09-20),
causing the request to always receive ""Your plan doesn't include this data timeframe. Please upgrade your plan at https://polygon.io/pricing" message, which is completely correct, but can be confusing to new users attempting your service.

To Reproduce

  1. with a fresh account, browse to https://polygon.io/docs/rest/stocks/aggregates/custom-bars
  2. click 'Run Query'

Expected behavior
that is the expected behavior with the range parameters, but it shouldn't be set at that point for new users attempting to use the service

Screenshots

Additional context
when i request with the following parameters:
https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/2024-01-09/2024-02-10?adjusted=true&sort=asc&limit=120&apiKey={YOUR_API_KEY}

i was able to get the correct response.

{
  "ticker": "AAPL",
  "queryCount": 23,
  "resultsCount": 23,
  "adjusted": true,
  "results": [
    {
      "v": 42841809,
      "vw": 184.3706,
      "o": 183.92,
      "c": 185.14,
      "h": 185.15,
      "l": 182.73,
      "t": 1704776400000,
      "n": 538180
    },
    {
      "v": 46792908,
      "vw": 185.2403,
      "o": 184.35,
      "c": 186.19,
      "h": 186.4,
      "l": 183.92,
      "t": 1704862800000,
      "n": 554778
    },
    {
      "v": 49128408,
      "vw": 185.0604,
      "o": 186.54,
      "c": 185.59,
      "h": 187.05,
      "l": 183.62,
      "t": 1704949200000,
      "n": 584008
    },
    {
      "v": 40477782,
      "vw": 185.8199,
      "o": 186.06,
      "c": 185.92,
      "h": 186.74,
      "l": 185.19,
      "t": 1705035600000,
      "n": 477050
    },
    {
      "v": 65603041,
      "vw": 182.8825,
      "o": 182.16,
      "c": 183.63,
      "h": 184.26,
      "l": 180.934,
      "t": 1705381200000,
      "n": 767284
    },
    {
      "v": 47317433,
      "vw": 181.9201,
      "o": 181.27,
      "c": 182.68,
      "h": 182.93,
      "l": 180.3,
      "t": 1705467600000,
      "n": 594632
    },
    {
      "v": 78005754,
      "vw": 187.9375,
      "o": 186.09,
      "c": 188.63,
      "h": 189.14,
      "l": 185.83,
      "t": 1705554000000,
      "n": 787235
    },
    {
      "v": 68902985,
      "vw": 190.6151,
      "o": 189.33,
      "c": 191.56,
      "h": 191.95,
      "l": 188.82,
      "t": 1705640400000,
      "n": 682664
    },
    {
      "v": 60133852,
      "vw": 193.9891,
      "o": 192.3,
      "c": 193.89,
      "h": 195.33,
      "l": 192.26,
      "t": 1705899600000,
      "n": 718108
    },
    {
      "v": 42355590,
      "vw": 194.8203,
      "o": 195.02,
      "c": 195.18,
      "h": 195.75,
      "l": 193.8299,
      "t": 1705986000000,
      "n": 533093
    },
    {
      "v": 53631316,
      "vw": 195.2063,
      "o": 195.42,
      "c": 194.5,
      "h": 196.38,
      "l": 194.34,
      "t": 1706072400000,
      "n": 594714
    },
    {
      "v": 54822126,
      "vw": 194.7337,
      "o": 195.22,
      "c": 194.17,
      "h": 196.2675,
      "l": 193.1125,
      "t": 1706158800000,
      "n": 644526
    },
    {
      "v": 44594011,
      "vw": 193.1206,
      "o": 194.27,
      "c": 192.42,
      "h": 194.76,
      "l": 191.94,
      "t": 1706245200000,
      "n": 534166
    },
    {
      "v": 47145622,
      "vw": 191.2954,
      "o": 192.01,
      "c": 191.73,
      "h": 192.2,
      "l": 189.58,
      "t": 1706504400000,
      "n": 599513
    },
    {
      "v": 55859370,
      "vw": 188.7925,
      "o": 190.94,
      "c": 188.04,
      "h": 191.8,
      "l": 187.47,
      "t": 1706590800000,
      "n": 690707
    },
    {
      "v": 55467803,
      "vw": 185.3525,
      "o": 187.04,
      "c": 184.4,
      "h": 187.095,
      "l": 184.35,
      "t": 1706677200000,
      "n": 679844
    },
    {
      "v": 64885408,
      "vw": 185.5688,
      "o": 183.985,
      "c": 186.86,
      "h": 186.95,
      "l": 183.82,
      "t": 1706763600000,
      "n": 820977
    },
    {
      "v": 102551680,
      "vw": 184.7435,
      "o": 179.86,
      "c": 185.85,
      "h": 187.33,
      "l": 179.25,
      "t": 1706850000000,
      "n": 1108466
    },
    {
      "v": 69668820,
      "vw": 187.6826,
      "o": 188.15,
      "c": 187.68,
      "h": 189.25,
      "l": 185.84,
      "t": 1707109200000,
      "n": 804749
    },
    {
      "v": 43490759,
      "vw": 188.4788,
      "o": 186.86,
      "c": 189.3,
      "h": 189.31,
      "l": 186.7695,
      "t": 1707195600000,
      "n": 530825
    },
    {
      "v": 53438955,
      "vw": 189.3803,
      "o": 190.64,
      "c": 189.41,
      "h": 191.05,
      "l": 188.61,
      "t": 1707282000000,
      "n": 596088
    },
    {
      "v": 40962046,
      "vw": 188.3032,
      "o": 189.385,
      "c": 188.32,
      "h": 189.535,
      "l": 187.35,
      "t": 1707368400000,
      "n": 521464
    },
    {
      "v": 45155216,
      "vw": 189.0056,
      "o": 188.65,
      "c": 188.85,
      "h": 189.99,
      "l": 188,
      "t": 1707454800000,
      "n": 544714
    }
  ],
  "status": "OK",
  "request_id": "0a0e99f813d625bd8053f5b363ff99df",
  "count": 23
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions