assafelovic/gpt-researcher · warning · Exception

No results found with fastCRW API search.

Error message

No results found with fastCRW API search.

What it means

Exception raised by the fastCRW retriever's public search() when the response envelope's data field is missing, empty, or not a list — i.e. the API call succeeded but returned zero usable sources for the query.

Source

Thrown at gpt_researcher/retrievers/crw/crw.py:112

        response.raise_for_status()
        results = response.json()
        # fastCRW wraps responses in a {success, error, data} envelope.
        if results.get("success") is False:
            raise Exception(results.get("error", "fastCRW API search failed."))
        return results

    def search(self, max_results=10):
        """
        Searches the query
        Returns:

        """
        try:
            # Search the query
            results = self._search(self.query, max_results=max_results)
            sources = results.get("data") or []
            if not isinstance(sources, list) or not sources:
                raise Exception("No results found with fastCRW API search.")
            # Return the results. A source missing "url" is unusable, so skip it
            # rather than raising a KeyError that discards the whole result set.
            search_response = []
            for obj in sources:
                if not isinstance(obj, dict):
                    continue
                href = obj.get("url") or ""
                if not href:
                    continue
                search_response.append(
                    {
                        "href": href,
                        "body": obj.get("markdown") or obj.get("description") or "",
                    }
                )
        except Exception as e:
            print(f"Error: {e}. Failed fetching sources. Resulting in empty response.")
            search_response = []

View on GitHub (pinned to 6f998577d5)

Solutions

  1. Broaden or rephrase the query and retry.
  2. Inspect the raw fastCRW response for that query (curl it) to confirm data is genuinely empty.
  3. Handle the exception and fall back to another retriever for empty-result cases.
  4. If data exists but has a new shape, update the parsing in search().

Example fix

# before
results = retriever.search()

# after
try:
    results = retriever.search()
except Exception as e:
    if "No results" in str(e):
        results = []
    else:
        raise
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

try:
    results = retriever.search()
except Exception as e:
    results = [] if "No results" in str(e) else raise_

Prevention

When it happens

Trigger: search() calls _search(); results.get("data") is None, empty, or a non-list (e.g. an error dict), triggering the raise.

Common situations: Overly narrow/obscure queries with no matches, upstream data source returning empty sets, or API responses where data is renamed/restructured after an update.

Related errors


AI-assisted analysis of assafelovic/gpt-researcher@6f998577d5 (2026-08-28). Data as JSON: /api/errors/f5161a360f1b6eee. Report an issue: GitHub.