{"id":19421831,"url":"https://github.com/capturr/price-extract","last_synced_at":"2026-04-30T12:32:27.036Z","repository":{"id":57330289,"uuid":"401728005","full_name":"capturr/price-extract","owner":"capturr","description":"Performant way to extract price amount and metadatas (currency, decimal \u0026 thousands separator) from any string.","archived":false,"fork":false,"pushed_at":"2021-09-21T07:37:03.000Z","size":13,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-15T03:51:58.480Z","etag":null,"topics":["amount","crawler","crawling","currencies","currency","extract","extractor","javascript","nodejs","parser","parsing","price","scraper","scraping","spider","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/capturr.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-31T14:12:24.000Z","updated_at":"2023-08-21T22:44:40.000Z","dependencies_parsed_at":"2022-09-21T02:21:19.205Z","dependency_job_id":null,"html_url":"https://github.com/capturr/price-extract","commit_stats":null,"previous_names":["dopamyn/price-extract","datasaucer/price-extract"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/capturr/price-extract","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capturr%2Fprice-extract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capturr%2Fprice-extract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capturr%2Fprice-extract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capturr%2Fprice-extract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capturr","download_url":"https://codeload.github.com/capturr/price-extract/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capturr%2Fprice-extract/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32465009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["amount","crawler","crawling","currencies","currency","extract","extractor","javascript","nodejs","parser","parsing","price","scraper","scraping","spider","typescript"],"created_at":"2024-11-10T13:30:08.707Z","updated_at":"2026-04-30T12:32:27.017Z","avatar_url":"https://github.com/capturr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Extract Price from String\n\nPerformant way to extract price amount and metadatas (currency, decimal \u0026 thousands separator) from any string.\n\n[![npm](https://img.shields.io/npm/v/price-extract)](https://www.npmjs.com/package/price-extract)\n\n## Installation\n\n```bash\nnpm install --save price-extract\n```\n\n## API\n\n```typescript\nextractPrice( \n    input: string, \n    details?: boolean = false, \n    debug?: boolean = false \n): TPrice | number | null;\n\ntype TAmount = { \n    number: number, \n    decsep?: string, \n    grpsep?: string \n}\n\ntype TCurrency = { \n    symbol: string, \n    iso: string, \n    match: string, \n    index: number \n}\n\ntype TPrice = TAmount \u0026 { currency: TCurrency }\n```\n\n## Return Value\n\n* **null**: When the price could not be parsed\n* **number**: The extracted price value\n* **object**: The extract price informations (when details = true)\n\n## Example\n\n```typescript\nimport extractPrice from 'price-extract';\n\nconsole.log(\n    \n    extractPrice('starting from 1 185,36 € (including taxes)'),\n    /* 1185.36 */\n\n    extractPrice('$ 85,4556.34'),\n    /* 556.34 */\n\n    extractPrice('There is no price here hahaha $$'),\n    /* null */\n    \n    extractPrice('12,456.24 USD', true), \n    /* { \n        number: 12456.24, \n        decsep: '.', \n        grpsep: ',', \n        currency: { \n            symbol: '$', \n            iso: 'USD', \n            match: 'USD',\n            index: 10\n        } \n    } */\n);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapturr%2Fprice-extract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapturr%2Fprice-extract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapturr%2Fprice-extract/lists"}