{"id":46225767,"url":"https://github.com/massive-com/client-js","last_synced_at":"2026-03-03T16:10:45.742Z","repository":{"id":37896984,"uuid":"215102045","full_name":"massive-com/client-js","owner":"massive-com","description":"The official JS client library for the Massive.com REST and WebSocket API.","archived":false,"fork":false,"pushed_at":"2026-02-24T23:57:08.000Z","size":2941,"stargazers_count":262,"open_issues_count":10,"forks_count":73,"subscribers_count":11,"default_branch":"master","last_synced_at":"2026-02-25T02:48:19.029Z","etag":null,"topics":["api-client","javascript","js","lib","library","websocket"],"latest_commit_sha":null,"homepage":"https://massive.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/massive-com.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-10-14T17:12:33.000Z","updated_at":"2026-02-24T23:56:43.000Z","dependencies_parsed_at":"2026-02-05T20:03:37.552Z","dependency_job_id":null,"html_url":"https://github.com/massive-com/client-js","commit_stats":{"total_commits":156,"total_committers":27,"mean_commits":5.777777777777778,"dds":0.5833333333333333,"last_synced_commit":"856c83d0db086531c9f316b61513c7c1ba3bbcfe"},"previous_names":["bassochette/polygon.io","massive-com/client-js"],"tags_count":64,"template":false,"template_full_name":null,"purl":"pkg:github/massive-com/client-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massive-com%2Fclient-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massive-com%2Fclient-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massive-com%2Fclient-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massive-com%2Fclient-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/massive-com","download_url":"https://codeload.github.com/massive-com/client-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massive-com%2Fclient-js/sbom","scorecard":{"id":227023,"data":{"date":"2025-08-11","repo":{"name":"github.com/polygon-io/client-js","commit":"25d8ff7ec2152a014224ecab11967d1e3246b485"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.6,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/publish.yml:7","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":9,"reason":"Found 29/30 approved changesets -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":8,"reason":"9 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/polygon-io/client-js/publish.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/publish.yml:21","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"10 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-cj7v-w2c7-cp7c","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T03:59:33.370Z","repository_id":37896984,"created_at":"2025-08-17T03:59:33.370Z","updated_at":"2025-08-17T03:59:33.370Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30051231,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T15:26:47.567Z","status":"ssl_error","status_checked_at":"2026-03-03T15:26:17.132Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","javascript","js","lib","library","websocket"],"created_at":"2026-03-03T16:10:45.190Z","updated_at":"2026-03-03T16:10:45.737Z","avatar_url":"https://github.com/massive-com.png","language":"TypeScript","readme":"# Massive JS Client\n\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\nWelcome to the official JS client library for the [Massive](https://massive.com/) REST and WebSocket API. To get started, please see the [Getting Started](https://massive.com/docs/stocks/getting-started) section in our documentation, view the [examples](./examples/) directory for code snippets, or the [blog post](https://massive.com/blog/javascript-stock-market-data/) with video tutorials to learn more. To generate the package documentation please run `npm run generate-doc`.\n\nFor upgrade instructions please see the [Release Notes](./CHANGELOG.md).\n\n**Note:** Polygon.io has rebranded as [Massive.com](https://massive.com) on Oct 30, 2025. Existing API keys, accounts, and integrations continue to work exactly as before. The only change in this SDK is that it now defaults to the new API base at `api.massive.com`, while `api.polygon.io` remains supported for an extended period.\n\nFor details, see our [rebrand announcement blog post](https://massive.com/blog/polygon-is-now-massive/) or open an issue / contact [support@massive.com](mailto:support@massive.com) if you have questions.\n\n## Getting the client\n\nTo get started, you'll need to install the client library:\n\n```bash\nnpm install --save '@massive.com/client-js'\n```\n\nNext, create a new client with your [API key](https://massive.com/dashboard/signup).\n\n```javascript\nimport { restClient } from '@massive.com/client-js';\nconst rest = restClient(process.env.POLY_API_KEY);\n```\n\n## Using the client\n\nAfter creating the client, making calls to the Massive API is easy. For example, here's a complete example on how to get aggregates (bars):\n\n```javascript\nimport { restClient } from '@massive.com/client-js';\n\nconst apiKey = \"XXXX\";\nconst rest = restClient(apiKey, 'https://api.massive.com');\n\nasync function example_getStocksAggregates() {\n  try {\n    const response = await rest.getStocksAggregates(\n      {\n        stocksTicker: \"AAPL\",\n        multiplier: \"1\",\n        timespan: \"day\",\n        from: \"2025-11-01\",\n        to: \"2025-11-30\",\n        adjusted: \"true\",\n        sort: \"asc\",\n        limit: \"120\"\n      }\n    );\n    console.log('Response:', response);\n  } catch (e) {\n    console.error('An error happened:', e);\n  }\n}\n\nexample_getStocksAggregates();\n```\n\nOr, maybe you want to get the last trades or quotes for a ticker:\n\n```javascript\nimport { restClient } from '@massive.com/client-js';\n\nconst apiKey = \"XXXX\";\nconst rest = restClient(apiKey, 'https://api.massive.com');\n\nasync function example_getLastStocksTrade() {\n  try {\n    const response = await rest.getLastStocksTrade(\"AAPL\");\n    console.log('Response:', response);\n  } catch (e) {\n    console.error('An error happened:', e);\n  }\n}\n\nexample_getLastStocksTrade();\n```\n\n```javascript\nimport { restClient } from '@massive.com/client-js';\n\nconst apiKey = \"XXXXX\";\nconst rest = restClient(apiKey, 'https://api.massive.com');\n\nasync function example_getLastStocksQuote() {\n  try {\n    const response = await rest.getLastStocksQuote(\"AAPL\");\n    console.log('Response:', response);\n  } catch (e) {\n    console.error('An error happened:', e);\n  }\n}\n\nexample_getLastStocksQuote();\n```\n\nFinally, maybe you want a snapshot of a ticker:\n\n```javascript\nimport { restClient } from '@massive.com/client-js';\n\nconst apiKey = \"XXXXX\";\nconst rest = restClient(apiKey, 'https://api.massive.com');\n\nasync function example_getStocksSnapshotTicker() {\n  try {\n    const response = await rest.getStocksSnapshotTicker(\"AAPL\");\n    console.log('Response:', response);\n  } catch (e) {\n    console.error('An error happened:', e);\n  }\n}\n\nexample_getStocksSnapshotTicker();\n```\n\nSee [full examples](./examples/rest/) for more details on how to use this client effectively. \n\n## Pagination\n\nThe client can handle pagination for you through the `globalFetchOptions` by turning on the `pagination: true` option. The feature will automatically fetch all `next_url` pages of data when the API response indicates more data is available.\n\n```javascript\nimport { restClient } from '@massive.com/client-js';\n\nconst globalFetchOptions = {\n\tpagination: true,\n};\nconst rest = restClient(process.env.POLY_API_KEY, \"https://api.massive.com\", globalFetchOptions);\n\nrest.getStocksAggregates({\n  stocksTicker: \"AAPL\",\n  multiplier: \"1\",\n  timespan: \"day\",\n  from: \"2025-11-01\",\n  to: \"2025-11-30\"\n}).then((response) =\u003e {\n\tconst data = response.data; // convert axios-wrapped response\n\tconst resultCount = data.resultsCount;\n\tconsole.log(\"Result count:\", resultCount);\n}).catch(e =\u003e {\n\tconsole.error('An error happened:', e);\n});\n```\n\nIf there is a `next_url` field in the API response, the client will recursively fetch the next page for you, and then pass along the accumulated data.\n\n## WebSocket Client\n\nImport the [Websocket](https://massive.com/docs/stocks/ws_getting-started) client and models packages to get started. You can get preauthenticated [websocket clients](https://www.npmjs.com/package/websocket) for the 3 topics.\n\n```javascript\nimport { websocketClient } from \"@massive.com/client-js\";\nconst stocksWS = websocketClient(process.env.POLY_API_KEY, 'wss://delayed.massive.com').stocks();\n\nstocksWS.onmessage = ({response}) =\u003e {\n  const [message] = JSON.parse(response);\n\n  stocksWS.send('{\"action\":\"subscribe\", \"params\":\"AM.MSFT,A.MSFT\"}');\n\n  switch (message.ev) {\n    case \"AM\":\n      // your trade message handler\n      break;\n    case \"A\":\n      // your trade message handler\n      break;\n  }\n};\n\nstocksWS.send({ action: \"subscribe\", params: \"T.MSFT\" });\n```\nSee [full examples](./examples/websocket/) for more details on how to use this client effectively.\n\n## Contributing\n\nIf you found a bug or have an idea for a new feature, please first discuss it with us by [submitting a new issue](https://github.com/massive.com/client-js/issues/new/choose). We will respond to issues within at most 3 weeks. We're also open to volunteers if you want to submit a PR for any open issues but please discuss it with us beforehand. PRs that aren't linked to an existing issue or discussed with us ahead of time will generally be declined. If you have more general feedback or want to discuss using this client with other users, feel free to reach out on our [Slack channel](https://massive.com.slack.com/archives/C03FCSBSAFL).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmassive-com%2Fclient-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmassive-com%2Fclient-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmassive-com%2Fclient-js/lists"}