# getBar and getAggregate api are missing on alpaca js object

**URL:** <https://forum.alpaca.markets/t/getbar-and-getaggregate-api-are-missing-on-alpaca-js-object/8513>\
**Category:** Getting Started with Alpaca\
**Created:** [February 25, 2022, 1:22pm UTC](https://forum.alpaca.markets/t/getbar-and-getaggregate-api-are-missing-on-alpaca-js-object/8513 "2022-02-25T13:22:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunilagrawal](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@sunilagrawal](https://forum.alpaca.markets/u/sunilagrawal)\
**Post date:** [February 25, 2022, 1:22pm UTC](https://forum.alpaca.markets/t/getbar-and-getaggregate-api-are-missing-on-alpaca-js-object/8513/1 "2022-02-25T13:22:25Z")

</div>

I am not able to run code given on the link - [A Simple Stock Screener Using Node.js (alpaca.markets)](https://alpaca.markets/learn/nodejs-stock-screener/)  
Below are the errors, i am getting… How to fix it?

TypeError: alpaca.getBars is not a function  
at Object. (D:\myproj\stockscreener\testalpaca.js:23:21)  
at Module.\_compile (node:internal/modules/cjs/loader:1101:14)  
at Object.Module.\_extensions…js (node:internal/modules/cjs/loader:1153:10)  
at Module.load (node:internal/modules/cjs/loader:981:32)  
at Function.Module.\_load (node:internal/modules/cjs/loader:822:12)  
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run\_main:81:12)  
at node:internal/main/run\_main\_module:17:47

const resp = alpaca.getHistoricAggregatesV2(stock,  
^

TypeError: alpaca.getAggregates is not a function  
at Object. (D:\myproj\stockscreener\testalpaca.js:25:21)  
at Module.\_compile (node:internal/modules/cjs/loader:1101:14)  
at Object.Module.\_extensions…js (node:internal/modules/cjs/loader:1153:10)  
at Module.load (node:internal/modules/cjs/loader:981:32)  
at Function.Module.\_load (node:internal/modules/cjs/loader:822:12)  
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run\_main:81:12)  
at node:internal/main/run\_main\_module:17:47
