Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(sdks): clean removal errors and align developer search docs (#5569)

Kris Oei9c711988023b
diff --git a/apps/elixir-sdk/openapi.json b/apps/elixir-sdk/openapi.json
index 9b900b49b..2e5974921 100644
--- a/apps/elixir-sdk/openapi.json
+++ b/apps/elixir-sdk/openapi.json
@@ -12812,19 +12812,9 @@
"properties": {
"id": {
"type": "string",
- "description": "Stable result id, such as `issue:owner/repo#123`.",
+ "description": "Stable result id, such as `issue:owner/repo#123`. The prefix is the result kind.",
"example": "issue:firecrawl/firecrawl#1234"
},
- "type": {
- "type": "string",
- "enum": [
- "doc",
- "issue",
- "pull_request",
- "readme"
- ],
- "description": "Result kind."
- },
"url": {
"type": "string",
"format": "uri"
@@ -12841,9 +12831,46 @@
"properties": {
"text": {
"type": "string"
+ },
+ "citation_url": {
+ "type": "string",
+ "format": "uri",
+ "description": "URL to cite for this passage."
+ },
+ "truncated": {
+ "type": "boolean",
+ "description": "Present and true when `text` omits bytes from the full passage."
+ },
+ "served_span": {
+ "type": "object",
+ "description": "Byte offsets of `text` within the full passage when it is one contiguous span. Absent for table context assembled from separate rows.",
+ "required": [
+ "start",
+ "end"
+ ],
+ "properties": {
+ "start": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "end": {
+ "type": "integer",
+ "minimum": 0
+ }
+ }
+ },
+ "full_tokens_est": {
+ "type": "integer",
+ "minimum": 0,
+ "description": "Approximate token count of the full passage."
}
}
}
+ },
+ "license": {
+ "type": "string",
+ "description": "SPDX license id, verbatim, including `NOASSERTION`. Absent when the license is not known.",
+ "example": "MIT"
}
}
},
diff --git a/apps/js-sdk/firecrawl/src/v2/methods/research.ts b/apps/js-sdk/firecrawl/src/v2/methods/research.ts
index 7284b9d7e..39e1fde6d 100644
--- a/apps/js-sdk/firecrawl/src/v2/methods/research.ts
+++ b/apps/js-sdk/firecrawl/src/v2/methods/research.ts
@@ -53,7 +53,7 @@ function normalizeResearchError(err: any, action: string): never {
const body: any = err.response?.data;
if (body && (body.detail || body.title)) {
const message = body.detail || body.title;
- throw new SdkError(message, status, body.type, body);
+ throw new SdkError(message, status, body.code ?? body.type, body);
}
throw new SdkError(
err.message || `Request failed while trying to ${action}`,
diff --git a/apps/python-sdk/README.md b/apps/python-sdk/README.md
index e7d4aeed2..d41c92a4b 100644
--- a/apps/python-sdk/README.md
+++ b/apps/python-sdk/README.md
@@ -228,7 +228,8 @@ results = firecrawl.search(
)
```
-Results are grouped by source: `.web`, `.news`, `.images` and `.developer`.
+Results are grouped by source: `.web`, `.news` and `.images`. Developer and gov
+category results are served inside `.web`.
Use `categories` to narrow web search to a kind of site:
diff --git a/apps/python-sdk/firecrawl/v2/utils/error_handler.py b/apps/python-sdk/firecrawl/v2/utils/error_handler.py
index 9d205ddca..33f683e9c 100644
--- a/apps/python-sdk/firecrawl/v2/utils/error_handler.py
+++ b/apps/python-sdk/firecrawl/v2/utils/error_handler.py
@@ -7,6 +7,7 @@ from typing import Dict, Any, Optional, List
from .agent_hints import agent_hint_metadata
PROVIDER_TERMS_REQUIRED_CODE = "THIRD_PARTY_DATA_TERMS_REQUIRED"
+CATEGORY_REMOVED_CODE = "CATEGORY_REMOVED"
class FirecrawlError(Exception):
@@ -167,7 +168,9 @@ def handle_response_error(response: requests.Response, action: str) -> None:
message = f"{message} - {error_details}"
raise error_class(message, response.status_code, response, code=code, charge_id=charge_id, **hints)
- if response.status_code == 400:
+ if response.status_code == 400 and code == CATEGORY_REMOVED_CODE:
+ raise BadRequestError(error_message, response.status_code, response, code=code, charge_id=charge_id, **hints)
+ elif response.status_code == 400:
message = f"Bad Request: Failed to {action}. {error_message} - {error_details}"
raise BadRequestError(message, response.status_code, response, code=code, charge_id=charge_id, **hints)
elif response.status_code == 401:
@@ -184,6 +187,8 @@ def handle_response_error(response: requests.Response, action: str) -> None:
elif response.status_code == 408:
message = f"Request Timeout: Failed to {action} as the request timed out. {error_message} - {error_details}"
raise RequestTimeoutError(message, response.status_code, response, code=code, charge_id=charge_id, **hints)
+ elif response.status_code == 410:
+ raise FirecrawlError(error_message, response.status_code, response, code=code, charge_id=charge_id, **hints)
elif response.status_code == 429:
message = f"Rate Limit Exceeded: Failed to {action}. {error_message} - {error_details}"
raise RateLimitError(message, response.status_code, response, code=code, charge_id=charge_id, **hints)