Repository navigation
Add statusCode and finalUrl to fetch results - #147
Merged
Merged
Conversation
The API now returns the HTTP status of the fetched page and the URL it ended on after redirects, for fetch, batch fetch and web crawl. Add both as optional fields on FetchResponseData and PageData so callers can tell an error or block page from real content without casting. Bump version to 1.5.6. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
AHarmlessPyro
approved these changes
Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The API is adding two fields to fetch results: the HTTP status of the page that was read and the URL it ended on after redirects. This adds them to the SDK types so callers can tell an error or block page from real content without casting.
Changes
FetchResponseData(single fetch) andPageData(batch fetch and web crawl pages) gain optionalstatusCode?: numberandfinalUrl?: string.Both fields are optional: the API omits them when the browser received no response. The SDK passes response JSON through unchanged, so this is a types-only change.
Validation
yarn lintpasses.yarn buildpasses.npx vitest run tests/unit/public-types-contract.test.tspasses (8 tests).yarn typecheckreports one error intests/unit/session-web-bot-auth-proxy-routes.test.ts, which is also present onmainwithout this change.yarn test: 895 of 896 pass. The one failure is a timeout intests/integration/computer-action.test.ts; that file also fails onmainlocally (three timeouts there), so it looks like a local flake rather than this change.Should be released once the API change that returns these fields is live.
🤖 Generated with Claude Code
Note
Low Risk
Types-only SDK update with optional fields and a contract test; no runtime or auth/data-path changes.
Overview
Aligns SDK types with new API fields on fetch responses so callers can distinguish blocks/redirects without casting. Optional
statusCodeandfinalUrlare added toFetchResponseData(single fetch) andPageData(batch scrape and crawl), with JSDoc noting they may be absent when there was no browser response or on older cached results.A public type-contract test locks in the optional shapes, and the package version is bumped to 1.5.6. Runtime behavior is unchanged—the SDK still forwards API JSON as-is.
Reviewed by Cursor Bugbot for commit 40bf794. Bugbot is set up for automated code reviews on this repo. Configure here.