Skip to content

Fallback to API trade query when HTML query fetch fails#9908

Open
Kanaxai wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
Kanaxai:fix-trade-url-403
Open

Fallback to API trade query when HTML query fetch fails#9908
Kanaxai wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
Kanaxai:fix-trade-url-403

Conversation

@Kanaxai

@Kanaxai Kanaxai commented Jun 27, 2026

Copy link
Copy Markdown

Fixes #9907.

Description of the problem being solved:

When using the "Price Item" feature with a pasted trade URL, PoB attempts to retrieve the saved trade query by downloading and parsing the trade search HTML page.

Recently, this request has started returning HTTP 403 responses for some users, causing the "Price Item" functionality to fail entirely.

This change preserves the existing behavior by first attempting to retrieve the query from the trade search HTML page. If that request fails, PoB now falls back to retrieving the query through the /api/trade/search// endpoint and continues the search normally.

This allows "Price Item" searches initiated from a trade URL to continue functioning even when the trade HTML page cannot be fetched.

Steps taken to verify a working solution:
Verified that "Price Item" succeeds when provided with a valid trade URL that previously returned HTTP 403.
Verified that search results are displayed correctly after the API fallback is used.
Verified that existing behavior remains unchanged when the HTML query fetch succeeds.
Verified that "Find Best" functionality continues to work as expected.
Link to a build that showcases this PR:

N/A

Before screenshot:

image

After screenshot:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Price item in trade feature returns 403 error

1 participant