This is not intended for use from client-side Javascript, as Twitter does not support cross-origin resource sharing (CORS) at this time. You’ll need to write server-side code in order to access the API directly.