Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

genius-0963
Copy link

@genius-0963 genius-0963 commented Sep 29, 2025

Summary

Fix Python SDK image search results not populating image_url, image_width, image_height. Also map news imageUrlimage_url.

Why this is helpful

  • Enables downstream apps to display images from search results without custom parsing.
  • Prevents crashes when code assumes image_url is a string.
  • Restores parity with API responses and improves developer ergonomics.

What this PR does

  • Adds field aliases so API camelCase (imageUrl, imageWidth, imageHeight) maps to SDK snake_case.
  • Coerces image_width/image_height to integers when provided as strings by the API.
  • Applies the same mapping to news results for image_url.

Changes

  • apps/python-sdk/firecrawl/v2/types.py
    • SearchResultImages: aliases for imageUrl, imageWidth, imageHeight; dimension coercion to int.
    • SearchResultNews: alias for imageUrl.

Repro

from firecrawl import Firecrawl
fc = Firecrawl(api_key="MY-API-KEY")
res = fc.search(query="test", limit=2, sources=["images"])
for r in res.images:
    print(r.title, r.url, r.image_url, r.image_width, r.image_height)  # previously None

Validation

  • Editable install from repo; ran snippet.
  • image_url populated; image_width/image_height integers when present (else None).

Backward compatibility

  • No breaking changes. Snake_case attributes preserved; camelCase accepted via aliases.

Checklist

  • Lint passes on edited file
  • Verified against live API

Summary by cubic

Fixes Python SDK search results so image_url, image_width, and image_height are correctly populated for images and news. Maps API camelCase fields to snake_case and coerces width/height to integers.

  • Bug Fixes
    • Map API fields: imageUrl → image_url, imageWidth → image_width, imageHeight → image_height; and news.imageUrl → image_url.
    • Coerce image_width/image_height from strings to ints.
    • Backward compatible; no API changes.

…ageHeight) to snake_case and coerce dimensions
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.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.