Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. πŸ”₯

feat(search): accept the gov category

PhantomInTheWire8cc906812030
diff --git a/apps/js-sdk/firecrawl/README.md b/apps/js-sdk/firecrawl/README.md
index 3e8fa9e79..1bbd87430 100644
--- a/apps/js-sdk/firecrawl/README.md
+++ b/apps/js-sdk/firecrawl/README.md
@@ -191,7 +191,7 @@ const scraped = await app.search('firecrawl changelog', {
```
Results are grouped by source: `.web`, `.news` and `.images`. Developer
-category results are served inside `.web`.
+and gov category results are served inside `.web`.
Use `categories` to narrow web search to a kind of site:
@@ -242,6 +242,8 @@ Use `legalRegulatorySearch` to search the Legal and Regulatory Index: primary
law and regulatory material from US federal, state, and local government
sources, including statutes, regulations, codes, court opinions, and other
government publications. Results come back in the ordinary web-result shape.
+Generic `search(..., { categories: ['gov'] })` returns index results inside
+`.web`; like `developer`, it cannot be combined with other categories.
```js
const law = await app.legalRegulatorySearch('food labeling requirements', {
diff --git a/apps/js-sdk/firecrawl/src/v2/types.ts b/apps/js-sdk/firecrawl/src/v2/types.ts
index 8af462474..5ef12d48c 100644
--- a/apps/js-sdk/firecrawl/src/v2/types.ts
+++ b/apps/js-sdk/firecrawl/src/v2/types.ts
@@ -983,6 +983,8 @@ export interface AlexandriaOptions {
* - `pdf` β€” restrict results to PDFs (adds `filetype:pdf`).
* - `developer` β€” developer-index results (issues, pull requests, READMEs and
* documentation) served in `web`; cannot be combined with other categories.
+ * - `gov` β€” legal and regulatory results served in `web`; cannot be combined
+ * with other categories.
*
* ⚠️ `categories: ["research"]` is **not** Firecrawl's research paper index.
* To search papers themselves β€” ~43M abstracts, roughly 90% biomedical
@@ -994,7 +996,7 @@ export interface AlexandriaOptions {
* happen to live on academic domains β†’ `search({ categories: ["research"] })`.
*/
export interface CategoryOption {
- type: "github" | "research" | "pdf" | "developer";
+ type: "github" | "research" | "pdf" | "developer" | "gov";
}
export interface SearchRequest {
@@ -1016,7 +1018,7 @@ export interface SearchRequest {
* `firecrawl.research.searchPapers()` instead.
*/
categories?: Array<
- "github" | "research" | "pdf" | "developer" | CategoryOption
+ "github" | "research" | "pdf" | "developer" | "gov" | CategoryOption
>;
includeDomains?: string[];
excludeDomains?: string[];
diff --git a/apps/python-sdk/README.md b/apps/python-sdk/README.md
index c8b8c994a..21973c10e 100644
--- a/apps/python-sdk/README.md
+++ b/apps/python-sdk/README.md
@@ -264,6 +264,8 @@ Use `legal_regulatory_search` to search the Legal and Regulatory Index: primary
law and regulatory material from US federal, state, and local government
sources, including statutes, regulations, codes, court opinions, and other
government publications. Results come back in the ordinary web-result shape.
+Generic `search(categories=["gov"])` returns index results inside `.web`;
+like `developer`, it cannot be combined with other categories.
```python
law = firecrawl.legal_regulatory_search("food labeling requirements", k=5)
diff --git a/apps/python-sdk/firecrawl/v2/methods/search.py b/apps/python-sdk/firecrawl/v2/methods/search.py
index b46709688..0cb884863 100644
--- a/apps/python-sdk/firecrawl/v2/methods/search.py
+++ b/apps/python-sdk/firecrawl/v2/methods/search.py
@@ -136,7 +136,7 @@ def _validate_search_request(request: SearchRequest) -> SearchRequest:
# Validate categories (if provided)
if request.categories is not None:
- valid_categories = {"github", "research", "pdf", "developer"}
+ valid_categories = {"github", "research", "pdf", "developer", "gov"}
for category in request.categories:
if isinstance(category, str):
if category not in valid_categories:
diff --git a/apps/python-sdk/firecrawl/v2/types.py b/apps/python-sdk/firecrawl/v2/types.py
index 3c0738b8f..676e2cfef 100644
--- a/apps/python-sdk/firecrawl/v2/types.py
+++ b/apps/python-sdk/firecrawl/v2/types.py
@@ -635,6 +635,8 @@ class Category(BaseModel):
- "pdf": Filter results to PDF files (adds filetype:pdf to search)
- "developer": Developer-index results (issues, pull requests, READMEs and
documentation) served in `web`; cannot be combined with other categories
+ - "gov": Legal and regulatory results served in `web`; cannot be combined
+ with other categories
.. warning::
``categories=["research"]`` is **not** Firecrawl's research paper index.