{"_id":"@adaptive-ds/outscraper-client","name":"@adaptive-ds/outscraper-client","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@adaptive-ds/outscraper-client","version":"0.1.0","description":"TypeScript Result-based API client for Outscraper (Google Maps, Reviews, Leads, Emails, Serp, and Business Search). Type-safe, Valibot-validated, and modern.","keywords":["outscraper","outscraper-api","google-maps-scraper","google-reviews","leads","email-extractor","api-client","typescript","result","valibot"],"homepage":"https://github.com/david1gp/outscraper-client","repository":{"type":"git","url":"git+https://github.com/david1gp/outscraper-client.git"},"bugs":{"url":"https://github.com/david1gp/outscraper-client/issues"},"license":"MIT","type":"module","private":false,"main":"dist/index.js","types":"./dist/index.d.ts","bin":{"outscraper-client":"dist/cli.js"},"scripts":{"dev":"bun test --watch","test":"bun test","test:task1":"bun test test/openApiGeneration.test.ts","test:w":"bun test --watch","build":"rm -rf ./dist && bun tsc -p ./tsconfig.lib.json && chmod +x ./dist/cli.js","check":"bun tsc --noEmit","cli":"bun src/cli.ts","openapi:snapshot":"bun scripts/openapi-snapshot.ts","openapi:normalize":"bun scripts/openapi-normalize.ts","generate":"bun scripts/openapi-generate.ts && biome format --write src","release":"bash ./ops/release.sh","update":"bun update","format":"biome format --write src scripts test package.json tsconfig.json tsconfig.lib.json biome.json","clean":"rm -rf ./dist","reset":"rm -rf ./node_modules"},"peerDependencies":{"@adaptive-ds/result":"^0.6.0","valibot":"^1.2.0"},"devDependencies":{"@adaptive-ds/result":"^0.6.0","@biomejs/biome":"^2.5.2","@types/bun":"^1.3.13","typescript":"^6.0.3","valibot":"^1.2.0"},"prettier":{"semi":false,"printWidth":120,"trailingComma":"all"},"imports":{"#result":"@adaptive-ds/result"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./*":{"types":"./dist/*.d.ts","import":"./dist/*.js"}},"dependencies":{"@stricli/core":"^1.2.5"},"gitHead":"d8f807774a8b33b674744f2921779bd2b4886e03","_id":"@adaptive-ds/outscraper-client@0.1.0","_nodeVersion":"26.7.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-4wZ75U3o3OgVKx821sRxEXqszKSp6bqdd4C8g3D1x02qs6GyE2xMdDT4H+mq0t7nWq4y7Z61sn/GazeZYiKOCw==","shasum":"571fd230cb5b610f8b6d838b9ead7ebf88745331","tarball":"https://registry.npmjs.org/@adaptive-ds/outscraper-client/-/outscraper-client-0.1.0.tgz","fileCount":1859,"unpackedSize":5631504,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCSaFDgNo8Cx4LgMu1VVtWNI6O/dmGXVunecYvyzyjbGwIgEjWCt1TGAtxydzkn8PPgXfHIhWxWsF4SE//odiCLI4s="}]},"_npmUser":{"name":"david1gp","email":"david1gruppenplan@gmail.com"},"directories":{},"maintainers":[{"name":"david1gp","email":"david1gruppenplan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/outscraper-client_0.1.0_1787205394480_0.6282607302340153"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-20T05:56:34.230Z","0.1.0":"2026-08-20T05:56:34.653Z","modified":"2026-08-20T05:56:34.938Z"},"maintainers":[{"name":"david1gp","email":"david1gruppenplan@gmail.com"}],"description":"TypeScript Result-based API client for Outscraper (Google Maps, Reviews, Leads, Emails, Serp, and Business Search). Type-safe, Valibot-validated, and modern.","homepage":"https://github.com/david1gp/outscraper-client","keywords":["outscraper","outscraper-api","google-maps-scraper","google-reviews","leads","email-extractor","api-client","typescript","result","valibot"],"repository":{"type":"git","url":"git+https://github.com/david1gp/outscraper-client.git"},"bugs":{"url":"https://github.com/david1gp/outscraper-client/issues"},"license":"MIT","readme":"# @adaptive-ds/outscraper-client\n\nType-safe TypeScript library and CLI for the [Outscraper API](https://outscraper.com). Inputs and responses are validated with [Valibot](https://valibot.dev), and endpoint operations return [@adaptive-ds/result](https://github.com/david1gp/result) values.\n\n## Installation and authentication\n\n```bash\nbun add @adaptive-ds/outscraper-client @adaptive-ds/result valibot\nexport OUTSCRAPER_API_KEY=\"your-api-key\"\n```\n\nFor a global CLI installation, use `bun add --global @adaptive-ds/outscraper-client @adaptive-ds/result valibot`.\n\nKeep the key in the environment (or pass `--api-key` to the CLI); it is not printed in results or errors. `OUTSCRAPER_BASE_URL` may also override the API URL.\n\n## Library\n\nCreate a validated client, then call a generated operation. Generated inputs are grouped by HTTP location (`path`, `query`, `headers`, and, for body operations, `body`):\n\n```typescript\nimport {\n  googleMapsSearchGet,\n  outscraperClientCreateResult,\n} from \"@adaptive-ds/outscraper-client\"\n\nconst clientResult = outscraperClientCreateResult({\n  apiKey: process.env.OUTSCRAPER_API_KEY,\n})\nif (!clientResult.success) {\n  console.error(clientResult.errorMessage)\n} else {\n  const result = await googleMapsSearchGet(clientResult.data, {\n    query: {\n      async: false,\n      limit: 3,\n      query: \"coffee shops, Brooklyn, NY, USA\",\n    },\n  })\n\n  if (result.success) console.log(result.data)\n  else console.error(`${result.op}: ${result.errorMessage}`)\n}\n```\n\nPOST operations use the same convention. For example:\n\n```typescript\nimport { googleMapsSearchPost } from \"@adaptive-ds/outscraper-client\"\n\nif (clientResult.success) {\n  const result = await googleMapsSearchPost(clientResult.data, {\n    query: {\n      async: true,\n      limit: 3,\n      query: \"coffee shops, Brooklyn, NY, USA\",\n    },\n  })\n  if (result.success) console.log(result.data)\n}\n```\n\nEvery generated operation is exported from the package root. It is also importable by its generated endpoint path, for example:\n\n```typescript\nimport { googleMapsSearchGet } from \"@adaptive-ds/outscraper-client/get-google-maps-search/googleMapsSearchGet\"\n```\n\nThe source layout is `src/<method>-<path-slug>/`: each operation has an operation function, input schema, response schema, and definition. The checked-in normalized catalog at `openapi/outscraper-api.normalized.json` is the discovery source. The older convenience exports such as `googleMapsSearch` remain available for compatibility.\n\n## Results and asynchronous requests\n\nEndpoint calls return `Result<T>`:\n\n- success: `{ success: true, data }`\n- failure: `{ success: false, op, errorMessage }`\n\nInput, transport, HTTP, and response-validation failures are returned as errors rather than thrown by endpoint calls. Use `outscraperClientCreateResult` when client configuration should also follow this pattern. For an asynchronous operation, submit with `async: true`, read the returned request ID, and poll the generated `requestsRequestIdGet` operation:\n\n```typescript\nimport { googleMapsSearchGet, requestsRequestIdGet } from \"@adaptive-ds/outscraper-client\"\n\nif (clientResult.success) {\n  const started = await googleMapsSearchGet(clientResult.data, {\n    query: { async: true, limit: 3, query: \"dentists, Miami, FL, USA\" },\n  })\n  if (started.success && started.data && \"id\" in started.data && started.data.id) {\n    const status = await requestsRequestIdGet(clientResult.data, {\n      path: { requestId: started.data.id },\n    })\n    if (status.success) console.log(status.data)\n  }\n}\n```\n\n## CLI\n\nThe package installs the `outscraper-client` executable. See all generated routes and flags without making an API call:\n\n```bash\noutscraper-client --help\noutscraper-client get --help\noutscraper-client get google-maps-search --help\noutscraper-client post --help\noutscraper-client --version\n```\n\nRoutes are grouped by HTTP method and then use the endpoint path slug. Representative requests:\n\n```bash\noutscraper-client get google-maps-search \\\n  --query-query \"coffee shops, Brooklyn, NY, USA\" \\\n  --query-limit 3 \\\n  --query-async false\n\noutscraper-client post tasks \\\n  --body '{\"service_name\":\"google_maps_search\",\"queries\":[\"coffee shops, Brooklyn, NY, USA\"]}'\n```\n\nThe CLI writes successful data as JSON to stdout. Result errors are JSON on stderr with exit code `1`; API keys are redacted. During development, use `bun run cli -- --help` or `bun run cli -- get google-maps-search --help`.\n\n## Development and testing\n\n```bash\nbun install\nbun run openapi:snapshot       # fetch the official OpenAPI document\nbun run openapi:normalize      # normalize the checked-in snapshot\nbun run generate               # regenerate src endpoint files and exports\nbun run cli -- --help          # run the CLI from source\nbun run check                  # TypeScript check\nbun run test                   # Bun unit/integration tests\nbun run build                  # emit dist and the executable CLI\nbun run dev                    # test watch mode\nbun run format                # format source, scripts, tests, and config\n```\n\n`openapi:snapshot` uses the documented Outscraper OpenAPI URL by default; it is not needed for ordinary library or CLI use. `generate` reads `openapi/outscraper-api.normalized.json` by default and keeps generated exports and CLI routes in sync with that catalog.\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":"README.md","_rev":"1-02f6c68c9222f99fd5f2f46cce1d7392"}