All Projects → polygon-io → client-js

polygon-io / client-js

Licence: MIT license
JS client for polygon.io api

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to client-js

fs-pochta-api
Библиотека для работы с API Почты России
Stars: ✭ 15 (-81.48%)
Mutual labels:  lib, api-client
midtrans-python-client
Official Midtrans Payment API Client for Python | https://midtrans.com
Stars: ✭ 24 (-70.37%)
Mutual labels:  api-client
buttercms-go
Golang CMS and blog engine https://buttercms.com
Stars: ✭ 37 (-54.32%)
Mutual labels:  api-client
reload
Simple managed reload mechanism for Go
Stars: ✭ 18 (-77.78%)
Mutual labels:  lib
apiron
🍳 apiron is a Python package that helps you cook a tasty client for RESTful APIs. Just don't wash it with SOAP.
Stars: ✭ 106 (+30.86%)
Mutual labels:  api-client
logger-node
A nodejs logger client for LogDNA
Stars: ✭ 27 (-66.67%)
Mutual labels:  lib
platformsh-client-php
Platform.sh API client for PHP
Stars: ✭ 24 (-70.37%)
Mutual labels:  api-client
StudentVue.py
Python StudentVue Library
Stars: ✭ 17 (-79.01%)
Mutual labels:  api-client
TinyMAT
C/C++ library to handle writing simple Matlab(r) MAT file
Stars: ✭ 22 (-72.84%)
Mutual labels:  lib
Awesome NFTs
A curated collection about NFTs - by bt3gl
Stars: ✭ 42 (-48.15%)
Mutual labels:  polygon
laravel-tmdb
Interact with TMDB data in your Laravel application.
Stars: ✭ 25 (-69.14%)
Mutual labels:  api-client
twinfield
PHP 7.3+ Library for using the Twinfield API.
Stars: ✭ 28 (-65.43%)
Mutual labels:  api-client
TinyTIFF
lightweight TIFF reader/writer library (C/C++)
Stars: ✭ 91 (+12.35%)
Mutual labels:  lib
nyxx
Wrapper around Discord API for Dart
Stars: ✭ 217 (+167.9%)
Mutual labels:  api-client
nytimes
nytimes: Interacting with New York TImes APIs
Stars: ✭ 23 (-71.6%)
Mutual labels:  api-client
node-nightwatch-accessibility
Nightwatch.js utility assertion for accessibility testing with aXe
Stars: ✭ 16 (-80.25%)
Mutual labels:  lib
basecampy3
A Python API for Basecamp 3
Stars: ✭ 31 (-61.73%)
Mutual labels:  api-client
Calendarific
Calendarific holiday sensor for Home Assistant
Stars: ✭ 14 (-82.72%)
Mutual labels:  api-client
content-api-scala-client
A Scala client library for the Guardian's Content API
Stars: ✭ 37 (-54.32%)
Mutual labels:  api-client
webflow-ruby
🕸 🌀Webflow API bindings for Ruby
Stars: ✭ 20 (-75.31%)
Mutual labels:  api-client

polygon.io

code style: prettier

Install

npm install --save @polygon.io/client-js

usage

Authentication

  • call the desired client with your api key to initialize it
import { polygonClient, restClient, websocketClient } from "@polygon.io/client-js";
const rest = restClient("API KEY");

// you can use the api now

rest.forex
  .previousClose("C:EURUSD")
  .then(/* your success handler */)
  .catch(/* your error handler*/);

REST API

  • import all the rest submodule
import { restClient } from "@polygon.io/client-js";

const rest = restClient("api key");

rest.forex.previousClose("C:EURUSD").then(/* your success handler */);
  • import a specific submodule
import { referenceClient } from "@polygon.io/client-js";

const reference = referenceClient("api key");

reference.tickers().then(/* your success handler */);

Websocket

You can get preauthenticated websocket clients for the 3 topics.

import { websocketClient } from "@polygon.io/client-js";

const stocksWS = websocketClient("api key").stocks();

stocksWS.onmessage = ({data}) => {
  const [message] = JSON.parse(data);

  stocksWS.send('{"action":"subscribe", "params":"AM.MSFT,A.MSFT"}');

  switch (message.ev) {
    case "AM":
      // your trade message handler
      break;
    case "A":
      // your trade message handler
      break;
  }
};

stocksWS.send({ action: "subscribe", params: "T.MSFT" });

documentation

  • Generate the package documentation
npm run generate-doc
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].