{"openapi":"3.1.0","info":{"title":"Grainger API (Bowmark)","version":"e833508f87ff","description":"Grainger's industrial MRO catalog, product detail, and branch/stock availability — search (keyword/category catalog search returning name, item number, brand, price and thumbnail), findBranch (nationwide branch directory), getProduct (price, pack size, spec table, availability by item number or URL) and checkStock (shipping-to-zip and pickup-at-nearest-branch fulfillment estimates) are all live.\n\nEvery function Bowmark has for Grainger (grainger.com) as one HTTP call. Each runs on Bowmark's infrastructure with the same billing, rules and response envelope as `POST /v1/run`. The whole API: https://api.bowmark.ai/openapi.json. Guide: https://bowmark.ai/docs/api.","contact":{"email":"support@bowmark.ai","url":"https://bowmark.ai/docs/api"}},"servers":[{"url":"https://api.bowmark.ai"}],"security":[{"bearer":[]},{"apiKeyHeader":[]}],"paths":{"/v1/sites/grainger/search":{"post":{"operationId":"search","summary":"Searches Grainger's industrial MRO catalog by keyword, returning matching products — item number, name, brand, list price and thumbnail.","description":"Searches Grainger's industrial MRO catalog by keyword, returning matching products — item number, name, brand, list price and thumbnail. Takes `query` (free text, e.g. \"antistatic gloves\"). A SPECIFIC query resolves to Grainger's own matching leaf category and returns its real products; a broad query (e.g. \"gloves\" alone) can resolve to a category-of-categories browse page one or more levels above any actual product and throws rather than returning an empty array — narrow the query if that happens.\n\nCalls `bowmark.providers.grainger.search`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<graingerSearchRow[]>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"$ref":"#/components/schemas/GraingerSearchArgs","description":"TypeScript: `GraingerSearchArgs`"}},"required":["args"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grainger/findBranch":{"post":{"operationId":"findBranch","summary":"Finds Grainger's own U.S.","description":"Finds Grainger's own U.S. branches near a ZIP, city or state — address, phone, hours and curbside-pickup availability, off the site's own nationwide directory. `zip` matches by its first three digits (a real USPS regional grouping; there is no geocode on either side to compute true distance). Needs at least one of `zip`, `city`, `state`, and a match set above 10 branches (e.g. a whole large state) asks the caller to narrow rather than silently truncating.\n\nCalls `bowmark.providers.grainger.findBranch`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<graingerBranchRow[]>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"$ref":"#/components/schemas/GraingerFindBranchArgs","description":"TypeScript: `GraingerFindBranchArgs`"}},"required":["args"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grainger/getProduct":{"post":{"operationId":"getProduct","summary":"Reads one Grainger product page in full — price and pack size/unit of measure, the full spec table, the manufacturer's own part number, and a shipping/pickup availability summary.","description":"Reads one Grainger product page in full — price and pack size/unit of measure, the full spec table, the manufacturer's own part number, and a shipping/pickup availability summary. Takes `itemNumber` (Grainger's own catalog id, e.g. \"26K909\" — resolves directly, no descriptive slug needed) or `url` (a full grainger.com product URL). Throws if the item number doesn't exist (a clean 404) rather than returning an empty row.\n\nCalls `bowmark.providers.grainger.getProduct`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<graingerProductRow>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"$ref":"#/components/schemas/GraingerGetProductArgs","description":"TypeScript: `GraingerGetProductArgs`"}},"required":["args"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grainger/checkStock":{"post":{"operationId":"checkStock","summary":"Checks real fulfillment availability for one item (`itemNumber` or `url`, same as `getProduct`) at a caller-supplied `zip` (required, 5-digit US) — both shipping-to-that-zip and pickup-at-the-nearest-","description":"Checks real fulfillment availability for one item (`itemNumber` or `url`, same as `getProduct`) at a caller-supplied `zip` (required, 5-digit US) — both shipping-to-that-zip and pickup-at-the-nearest-branch-to-that-zip, in one call. Returns the site's own message text (an arrival/ready-by estimate, never a literal stock count — the site doesn't publish one) plus its opaque status codes for each mode, and the ACTUAL branch that answered the pickup half (nearest-to-point, not necessarily one the caller could have named). Optional `quantity` (default 1) is forwarded to the site.\n\nCalls `bowmark.providers.grainger.checkStock`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<graingerStockRow>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"$ref":"#/components/schemas/GraingerCheckStockArgs","description":"TypeScript: `GraingerCheckStockArgs`"}},"required":["args"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Your Bowmark API key."},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-Bowmark-Key"}},"responses":{"NotFound":{"description":"No such site or function.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}},"schemas":{"RunEnvelope":{"type":"object","description":"What a run returns. `status` says whether the SCRIPT succeeded. A script that threw or paused for a login is still HTTP 200. Branch on `status`, not on the HTTP code.","required":["ok","status","result","logs","error","ms"],"properties":{"runId":{"type":"string","description":"Stable id for this run. Quote it in a support or `report` message."},"ok":{"type":"boolean","description":"False only when the run produced nothing usable."},"status":{"type":"string","enum":["ok","error","partial","needs_user"],"description":"`partial`: the result is real but some calls failed (see `incomplete`); `ok` stays true. `needs_user`: a person must sign in to a site first. Relay `meta.handoff.url` to them, then run again."},"egress":{"type":"string","enum":["default","link"],"description":"The egress the run was given, present only when the request asked for one. `link`: every request went through the caller's own Chrome (Bowmark Buddy)."},"result":{"description":"Whatever the script `return`ed. Any JSON value."},"logs":{"type":"array","items":{"type":"string"},"description":"Lines the script wrote with `log(...)`."},"error":{"type":["string","null"],"description":"Why the run failed, in plain words. Null on success."},"ms":{"type":"integer","description":"How long the script itself ran, in milliseconds."},"queuedMs":{"type":"integer","description":"How long the run waited for a worker before starting. Present only when it was a second or more."},"needs":{"type":"array","description":"The sign-ins this script is waiting on. Present when `status` is `needs_user`.","items":{"type":"object","required":["capability","provider","providerTitle","kind"],"properties":{"capability":{"type":"string"},"provider":{"type":"string"},"providerTitle":{"type":"string","description":"The site's name, to show a person."},"kind":{"type":"string"}}}},"incomplete":{"type":"object","description":"Present only when `status` is `partial`: which calls did not answer.","properties":{"summary":{"type":"string"},"totalCalls":{"type":"integer"}},"additionalProperties":true},"emptyHanded":{"type":"object","description":"Present when the script returned nothing while its calls returned rows, usually a filter that matched none of the site's own labels. Lists the label values the calls actually returned.","additionalProperties":true},"notes":{"type":"array","description":"Caveats a call attached to a complete answer. Never changes `status`.","items":{"type":"object","properties":{"path":{"type":"string"},"notes":{"type":"array","items":{"type":"string"}}}}},"meta":{"type":"object","properties":{"handoff":{"type":"object","description":"A single-use sign-in link for a person to open. Expires at `expiresAt`.","properties":{"ref":{"type":"string"},"url":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"}}},"concurrency":{"type":"object","description":"On a 429: how many runs are in flight and when to retry.","properties":{"limit":{"type":"integer"},"inFlight":{"type":"integer"},"retryAfterSeconds":{"type":"integer"}}}},"additionalProperties":true},"notice":{"type":"object","description":"Set when the account owner has not accepted the current Terms. Relay it to them.","additionalProperties":true}}},"GraingerCheckStockArgs":{"type":"object","properties":{"itemNumber":{"type":"string"},"url":{"type":"string"},"zip":{"type":"string"},"quantity":{"type":"number"}},"required":["zip"],"additionalProperties":true},"GraingerFindBranchArgs":{"type":"object","properties":{"zip":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"}},"additionalProperties":true},"GraingerGetProductArgs":{"type":"object","properties":{"itemNumber":{"type":"string"},"url":{"type":"string"}},"additionalProperties":true},"GraingerSearchArgs":{"type":"object","properties":{"query":{"type":"string"}},"required":["query"],"additionalProperties":true}}}}