{"_id":"@bytewaveco/public","_rev":"8-4a0bd60055b79bb520bf45785d13c662","name":"@bytewaveco/public","dist-tags":{"latest":"1.2.0"},"versions":{"0.0.1":{"name":"@bytewaveco/public","version":"0.0.1","keywords":["public","api","sdk","trading","investing"],"author":{"name":"Bytewave"},"license":"MIT","_id":"@bytewaveco/public@0.0.1","maintainers":[{"name":"kadengriffith","email":"kadengriffith@gmail.com"}],"dist":{"shasum":"a41fa5e64f95a2b6bc2c24be54ed3b4c572ec8d3","tarball":"https://registry.npmjs.org/@bytewaveco/public/-/public-0.0.1.tgz","fileCount":8,"integrity":"sha512-3VR3xL1NvVabB84q0CGxbELx+3Lv3EUKEnhSMgFn6maEXqMpucfG6ouK3Y6+YJFpDD4AMu7GpyjIT72lUtEjSQ==","signatures":[{"sig":"MEUCIQD4B4V5Owx6SqF5EHMO5+pYMVrRZdTfOyxnWtOq6sOkHwIgQrbC6hFBNbAxWqeCLw6PFDk7XiXAPem6IDMC6y+aafs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50102},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"413b8b4b21a2d45209e069b6ed9f9f7e3fce9379","scripts":{"build":"unbuild","prepack":"unbuild"},"_npmUser":{"name":"kadengriffith","email":"kadengriffith@gmail.com"},"_npmVersion":"11.5.1","description":"An unofficial SDK for the Public.com API.","directories":{},"_nodeVersion":"24.5.0","_hasShrinkwrap":false,"devDependencies":{"unbuild":"^3.6.0"},"_npmOperationalInternal":{"tmp":"tmp/public_0.0.1_1754956841861_0.13678270062268982","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@bytewaveco/public","version":"0.0.2","keywords":["public","api","sdk","trading","investing"],"author":{"name":"Bytewave"},"license":"MIT","_id":"@bytewaveco/public@0.0.2","maintainers":[{"name":"kadengriffith","email":"kadengriffith@gmail.com"}],"dist":{"shasum":"7a62ef036d111404423ad60f1d9b83a0f39940a4","tarball":"https://registry.npmjs.org/@bytewaveco/public/-/public-0.0.2.tgz","fileCount":8,"integrity":"sha512-WEKhSDNYUTlBhbTsvKrVM+yIA9E9HM1hOMkAoLSpiOoWU/vPCOIV0mLedEmfSsjses7odw2eiNec3JHJR+snYg==","signatures":[{"sig":"MEUCIC9R5v9OYbHg28ux4VPXwubpl56RJAAmfzV0fLFBDnLVAiEAzsBlVpgZmYbaNg4h3KTHdFVIElsfsuXE1cXw0WYAhuo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69921},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"1e72f3bea0c3e36af99a5abdae79ab5883cc6055","scripts":{"build":"unbuild","prepack":"unbuild"},"_npmUser":{"name":"kadengriffith","email":"kadengriffith@gmail.com"},"_npmVersion":"11.5.1","description":"An unofficial SDK for the Public.com API.","directories":{},"_nodeVersion":"24.5.0","dependencies":{"uuid":"^11.1.0"},"_hasShrinkwrap":false,"devDependencies":{"unbuild":"^3.6.0"},"_npmOperationalInternal":{"tmp":"tmp/public_0.0.2_1754959835090_0.7757342413676858","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@bytewaveco/public","version":"0.0.3","keywords":["public","api","sdk","trading","investing"],"author":{"name":"Bytewave"},"license":"MIT","_id":"@bytewaveco/public@0.0.3","maintainers":[{"name":"kadengriffith","email":"kadengriffith@gmail.com"}],"dist":{"shasum":"efd10edf68f6c6c9358859e4b6ed32ac98461c93","tarball":"https://registry.npmjs.org/@bytewaveco/public/-/public-0.0.3.tgz","fileCount":8,"integrity":"sha512-rsTVFRm7tkVW9TTEmM8viriRpq98tzo5Bl7K18eHR/XwNXdyfsvf6a5yCmTVImPIRUK40PWSwh+fG+5iQLMBxw==","signatures":[{"sig":"MEUCIQDeaHDwReJpLn502+0CGwuYdYELhqMyc1AEdMPArZlsWgIgNzR3dMmrWlX5krtGqhhI+P0XHB0Mgr8mxIw7DHTMBxk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":76471},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"1e72f3bea0c3e36af99a5abdae79ab5883cc6055","scripts":{"build":"unbuild","prepack":"unbuild"},"_npmUser":{"name":"kadengriffith","email":"kadengriffith@gmail.com"},"_npmVersion":"11.5.1","description":"A TypeScript compatible library for interacting with the Public API.","directories":{},"_nodeVersion":"24.5.0","dependencies":{"uuid":"^11.1.0"},"_hasShrinkwrap":false,"devDependencies":{"unbuild":"^3.6.0"},"_npmOperationalInternal":{"tmp":"tmp/public_0.0.3_1754963109722_0.788171869614827","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@bytewaveco/public","version":"0.0.4","keywords":["public","public.com","trading","investing","api","sdk","rest"],"author":{"name":"Bytewave"},"license":"MIT","_id":"@bytewaveco/public@0.0.4","maintainers":[{"name":"kadengriffith","email":"kadengriffith@gmail.com"}],"dist":{"shasum":"41517509ca7cd3a555dbd7b10776ffbfaefb5517","tarball":"https://registry.npmjs.org/@bytewaveco/public/-/public-0.0.4.tgz","fileCount":8,"integrity":"sha512-dcNb6byL1G6qFvY/nAiwS4io+cUcaUbqT6uYw9CobQdR59yWb9a1yGJ5Sk3GsiDVMKwIYUUUHP77lFdGJpnK3w==","signatures":[{"sig":"MEYCIQDnAdzeD+DkOFAHD7N+ZT5qVs4m/+dVUGFTMAlLz/Z0LwIhAKhEd41cue57iuK4iHvfZBzn0MNoGodCwbQ6BkpDN7TA","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":78834},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"3876da4bb040752dd3451e4f3a7125ead8260924","scripts":{"lint":"eslint . --fix","build":"unbuild","lint:ci":"eslint .","prepack":"unbuild"},"_npmUser":{"name":"kadengriffith","email":"kadengriffith@gmail.com"},"_npmVersion":"11.5.1","description":"A TypeScript compatible library for interacting with the Public API.","directories":{},"_nodeVersion":"24.5.0","dependencies":{"uuid":"^11.1.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.33.0","globals":"^16.3.0","unbuild":"^3.6.1","prettier":"^3.6.2","@eslint/js":"^9.33.0","typescript-eslint":"^8.40.0","eslint-plugin-prettier":"^5.5.4"},"_npmOperationalInternal":{"tmp":"tmp/public_0.0.4_1755650941217_0.47384354930391215","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@bytewaveco/public","version":"0.0.5","keywords":["public","public.com","trading","investing","api","sdk","rest"],"author":{"name":"Bytewave"},"license":"MIT","_id":"@bytewaveco/public@0.0.5","maintainers":[{"name":"kadengriffith","email":"kadengriffith@gmail.com"}],"dist":{"shasum":"f25014f560ca7f0038e4c3964715772177c0d6f1","tarball":"https://registry.npmjs.org/@bytewaveco/public/-/public-0.0.5.tgz","fileCount":8,"integrity":"sha512-aIU2/46NkCKL8N9Jxwr8ToaUK9JaqcXNSkl6SF2hkq9Cy401jeUPyu1/Ed+MDvLpI/VbjzgC+GazdQhjUlF4qA==","signatures":[{"sig":"MEUCICdSjiyxIDJMKnsBZuaUQ7Q1iPdgmy23aGnWOP98JahcAiEA0T0eEpSpptJ+0GX8xxOoH/V8JRZ1rsDzXIU2gjhuqsA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":112651},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"3876da4bb040752dd3451e4f3a7125ead8260924","scripts":{"lint":"eslint . --fix","build":"unbuild","lint:ci":"eslint .","prepack":"npm run build"},"_npmUser":{"name":"kadengriffith","email":"kadengriffith@gmail.com"},"_npmVersion":"11.5.1","description":"A TypeScript compatible library for interacting with the Public API.","directories":{},"_nodeVersion":"24.5.0","dependencies":{"uuid":"^12.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.35.0","globals":"^16.3.0","unbuild":"^3.6.1","prettier":"^3.6.2","@eslint/js":"^9.35.0","typescript":"^5.9.2","@types/node":"^24.3.1","typescript-eslint":"^8.42.0","eslint-plugin-prettier":"^5.5.4"},"_npmOperationalInternal":{"tmp":"tmp/public_0.0.5_1757111614669_0.41634131820166287","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@bytewaveco/public","version":"1.0.0","keywords":["public","public.com","trading","investing","api","sdk","rest"],"author":{"name":"Bytewave"},"license":"MIT","_id":"@bytewaveco/public@1.0.0","maintainers":[{"name":"kadengriffith","email":"kadengriffith@gmail.com"}],"dist":{"shasum":"6b10aab94a328e7512099248ffe18d5aa1c4d7b3","tarball":"https://registry.npmjs.org/@bytewaveco/public/-/public-1.0.0.tgz","fileCount":8,"integrity":"sha512-qGlgh/sYouPupJwICS1hSNjY244sqHO/qoXGskK1YQj2z5rdmG7jldegJyXUbi+Lz+Jmqizc1Tlh45aLipai7w==","signatures":[{"sig":"MEYCIQC4JeWmpgxvEVwD+CTvnaPCj77AQJhcYxH9mJ7Vai88DwIhAIdiLzcmVWLQIG58wiBzMUmpqu+8A+eYUiUfticH9Yzu","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":118843},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"21995a28e7b918b7b8c3b44517a45ebc4cd050fa","scripts":{"lint":"eslint . --fix","build":"unbuild","lint:ci":"eslint .","prepack":"npm run build"},"_npmUser":{"name":"kadengriffith","email":"kadengriffith@gmail.com"},"_npmVersion":"11.6.2","description":"A TypeScript compatible library for interacting with the Public API.","directories":{},"_nodeVersion":"25.2.1","dependencies":{"uuid":"^12.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.35.0","globals":"^16.3.0","unbuild":"^3.6.1","prettier":"^3.6.2","@eslint/js":"^9.35.0","typescript":"^5.9.2","@types/node":"^24.3.1","typescript-eslint":"^8.42.0","eslint-plugin-prettier":"^5.5.4"},"_npmOperationalInternal":{"tmp":"tmp/public_1.0.0_1767496988129_0.501518063873307","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@bytewaveco/public","version":"1.1.0","keywords":["api","investing","public","public.com","rest","sdk","trading"],"author":{"name":"Bytewave"},"license":"MIT","_id":"@bytewaveco/public@1.1.0","maintainers":[{"name":"kadengriffith","email":"kadengriffith@gmail.com"}],"dist":{"shasum":"9470f9c7d0dcfa495b18774a442f9df0af4f8158","tarball":"https://registry.npmjs.org/@bytewaveco/public/-/public-1.1.0.tgz","fileCount":8,"integrity":"sha512-grIyRT8sZA366EhuOn/QpQRvlCn5cKcbk42+JV+SALICmE9fpySvYO3xlHoRwXWcXuUKT62tAlF4jUKRbnM6Ag==","signatures":[{"sig":"MEYCIQDYHRaK/+UQJ2auYkbCaiqB4rcFAgQBkW+qYKY5AmfEwgIhAKGWLYqdqOCse3o2XpSE61JGHqrmdgrmFUwIK2xByOwV","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":130594},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"59d0888cb4b7499bee06ced5c028b3a63e055a26","scripts":{"fmt":"oxfmt --write .","lint":"oxfmt --write . && oxlint --fix .","test":"vitest run","build":"unbuild","check":"oxlint --deny-warnings . && oxfmt --check .","lint:ci":"pnpm run check","prepack":"pnpm run build","fmt:check":"oxfmt --check .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"kadengriffith","email":"kadengriffith@gmail.com"},"_npmVersion":"11.6.2","description":"A TypeScript compatible library for interacting with the Public API.","directories":{},"_nodeVersion":"25.2.1","dependencies":{"uuid":"^14.0.1"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.11.0","devDependencies":{"oxfmt":"^0.58.0","oxlint":"^1.73.0","vitest":"^4.1.10","unbuild":"^3.6.1","typescript":"^5.9.3","@types/node":"^26.x"},"_npmOperationalInternal":{"tmp":"tmp/public_1.1.0_1783748028004_0.6303426916640147","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@bytewaveco/public","version":"1.2.0","description":"A TypeScript compatible library for interacting with the Public API.","keywords":["api","investing","public","public.com","rest","sdk","trading"],"license":"MIT","author":{"name":"Bytewave"},"type":"module","main":"./dist/index.cjs","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"}},"scripts":{"build":"unbuild","check":"oxlint --deny-warnings . && oxfmt --check .","fmt":"oxfmt --write .","fmt:check":"oxfmt --check .","lint":"oxfmt --write . && oxlint --fix .","lint:ci":"pnpm run check","test":"vitest run","typecheck":"tsc --noEmit","prepack":"pnpm run build"},"dependencies":{"uuid":"^14.0.1"},"devDependencies":{"@types/node":"^26.x","oxfmt":"^0.58.0","oxlint":"^1.73.0","typescript":"^5.9.3","unbuild":"^3.6.1","vitest":"^4.1.10"},"packageManager":"pnpm@11.11.0","gitHead":"65bf94db60a08d8dfd38ecc849af470439276cf5","_id":"@bytewaveco/public@1.2.0","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-hWA7qrsgyPONIxSa9IUgTviuWlJPNpLwv2sr2WM9iDd1CR2/n34HbMhFhPoLXCPWc5EacEDneFjs9xqqiJFhaw==","shasum":"b4bd3726af570bf182936104de9db6c7433dfae7","tarball":"https://registry.npmjs.org/@bytewaveco/public/-/public-1.2.0.tgz","fileCount":8,"unpackedSize":115367,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHA4OY+N7FFndu7zxCsX2RM7yKthSKiq2ibTKB746WLhAiEA04eoLL1i6edBCwpj08DrwA5cgKWCtqaY4HJdxBPw3F0="}]},"_npmUser":{"name":"kadengriffith","email":"kadengriffith@gmail.com"},"directories":{},"maintainers":[{"name":"kadengriffith","email":"kadengriffith@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/public_1.2.0_1783749166648_0.32751610818531507"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-12T00:00:41.630Z","modified":"2026-07-11T05:52:46.918Z","0.0.1":"2025-08-12T00:00:42.037Z","0.0.2":"2025-08-12T00:50:35.299Z","0.0.3":"2025-08-12T01:45:09.921Z","0.0.4":"2025-08-20T00:49:01.443Z","0.0.5":"2025-09-05T22:33:34.827Z","1.0.0":"2026-01-04T03:23:08.263Z","1.1.0":"2026-07-11T05:33:48.132Z","1.2.0":"2026-07-11T05:52:46.782Z"},"author":{"name":"Bytewave"},"license":"MIT","keywords":["api","investing","public","public.com","rest","sdk","trading"],"description":"A TypeScript compatible library for interacting with the Public API.","maintainers":[{"name":"kadengriffith","email":"kadengriffith@gmail.com"}],"readme":"# Public API for TypeScript\n\nAn unofficial, fully typed TypeScript client for the\n[Public investing API](https://public.com/api/docs).\n\n> This package is not affiliated with Public. API requests use your live Public\n> account, and order methods can execute real trades. Review every order before\n> submitting it.\n\n## Install\n\n```sh\npnpm add @bytewaveco/public\n```\n\n```sh\nnpm install @bytewaveco/public\n```\n\n## Quickstart\n\nCreate a personal API secret in your Public account settings, then create a\nclient:\n\n```ts\nimport { createClient } from '@bytewaveco/public'\n\nconst publicClient = createClient(process.env.PUBLIC_API_SECRET!)\n\nconst result = await publicClient.accounts.listAccounts()\n\nif (result.error) {\n  throw result.error\n}\n\nconsole.log(result.data.accounts)\n```\n\nEvery request returns a discriminated result:\n\n```ts\ntype Result<T> = { data: T; error: null } | { data: null; error: Error }\n```\n\nHTTP errors are returned as `PublicApiError`, which includes the response\n`status` and parsed `body`.\n\n## Client options\n\n```ts\nconst publicClient = createClient(process.env.PUBLIC_API_SECRET!, {\n  accessTokenValidityInMinutes: 15,\n  headers: {\n    'X-Application': 'portfolio-tools',\n  },\n})\n```\n\n| Option                         | Description                                                        |\n| ------------------------------ | ------------------------------------------------------------------ |\n| `accessTokenValidityInMinutes` | Access-token lifetime from 5 through 1440 minutes. Defaults to 15. |\n| `baseUrl`                      | Override Public's API base URL.                                    |\n| `fetch`                        | Supply a custom Fetch API implementation.                          |\n| `headers`                      | Add headers to authenticated API requests.                         |\n\nAccess tokens are cached per client and refreshed shortly before expiry.\nConcurrent requests share the same token refresh.\n\n## API surface\n\n### Accounts\n\n```ts\npublicClient.accounts.listAccounts()\npublicClient.accounts.getAccount(accountId)\npublicClient.accounts.getAccountHistory(accountId, options)\n```\n\n### Instruments\n\n```ts\npublicClient.instruments.getInstruments(options)\npublicClient.instruments.getInstrument(symbol, type)\n```\n\nInstrument filters, trading states, crypto precision, bond details, shorting\navailability, exchanges, and option price increments are typed.\n\n### Market data\n\n```ts\npublicClient.marketData.getQuotes(accountId, instruments)\npublicClient.marketData.getBars(symbol, period, options)\n```\n\n### Options\n\n```ts\npublicClient.options.getOptionGreeks(accountId, osiSymbols)\npublicClient.options.getOptionExpirations(accountId, instrument)\npublicClient.options.getOptionChain(accountId, instrument, expirationDate)\npublicClient.options.getStrategyQuote(accountId, strategy)\n```\n\n### Orders\n\n```ts\nconst orderId = publicClient.orders.createOrderId()\n\nawait publicClient.orders.preflightSingleLeg(accountId, order)\nawait publicClient.orders.preflightMultiLeg(accountId, order)\nawait publicClient.orders.placeOrder(accountId, { ...order, orderId })\nawait publicClient.orders.placeOrderMultiLeg(accountId, { ...order, orderId })\nawait publicClient.orders.replaceOrder(accountId, replacement)\nawait publicClient.orders.getOrder(accountId, orderId)\nawait publicClient.orders.cancelOrder(accountId, orderId)\n```\n\nOrder placement and cancellation are asynchronous. Use `getOrder()` to verify\nthe resulting status. Current order types include 24/5 equity sessions, margin\ncontrols, short-sale position intent, stop-limit orders, and hypothetical\npreflight validation.\n\n## Current coverage\n\nVersion 1.2.0 reflects Public's documentation reviewed on July 10, 2026,\nincluding historical bars, replace-order, multi-leg strategy quotes, portfolio\nstrategies, option-chain Greeks, and current order controls.\n\n## Development\n\n```sh\npnpm install\npnpm check\npnpm typecheck\npnpm test\npnpm build\n```\n\n- `pnpm check` verifies Oxlint and Oxfmt.\n- `pnpm lint` applies formatting and safe lint fixes.\n- `pnpm test` runs the mocked transport tests. Tests do not contact Public or\n  place live orders.\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":"README.md"}