polygon-io / client-js

The official JS client library for the Polygon REST and WebSocket API.
MIT License
190 stars 59 forks source link

Getting multiple responses for Ticker Polgon IO #106

Closed mohdshoebali565 closed 1 year ago

mohdshoebali565 commented 2 years ago

Hi Team , We are trying to consume ticker polygon IO API and we are passing the expected parameters (see attached), but the request url / response parameters seems to be very different

Please see the expected output in the below mentioned url https://polygon.io/docs/stocks/get_v3_reference_tickers

Please find the output getting in the attached screenshot ( we are consuming the same API which was provided in the above url but the response is different)

Please do the needful

image

PolygonIOTicker
mohdshoebali565 commented 2 years ago

Can you please update on the ticket raised .. We are not able to proceed further ..its impacting our productivity

yehudabortz commented 1 year ago

@mohdshoebali565 Sorry for the delayed response from the team. Are you still encountering an issue here?

timetraveler328 commented 1 year ago

@mohdshoebali565 the first parameter passed to reference.tickers should be an object with all query parameters being passed to the endpoint (instead of passing them all to the function as individual parameters).

Your code should look like this instead await reference.tickers({ ticker, type, market, exchange, cik, date, active }) where each query element is an object key. In your example, you're passing an empty object as the first parameter, so no filters are included and it's returning all tickers.

timetraveler328 commented 1 year ago

Closing this issue as resolved by the solution above. Please feel free to create a new issue if you think there's still something here that needs addressed.