assafelovic/gpt-researcher · error · Exception

fastCRW API search failed.

Error message

fastCRW API search failed.

What it means

Exception raised by the fastCRW retriever's _search when the API responds successfully at the HTTP level but the JSON envelope has success == false. The message is the API's own error text, defaulting to "fastCRW API search failed." when the envelope omits it.

Source

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

        """

        data = {
            "query": query,
            "limit": max_results,
        }

        response = requests.post(
            f"{self.base_url}/v1/search",
            data=json.dumps(data),
            headers=self.headers,
            timeout=100,
        )
        # Raises a HTTPError if the HTTP request returned an unsuccessful status code
        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:

View on GitHub (pinned to 6f998577d5)

Solutions

  1. Read the exception text — it's the fastCRW error message naming the real cause.
  2. Verify your fastCRW credentials/endpoint configuration and remaining quota.
  3. Retry once after a short delay for transient service errors.
  4. Check the fastCRW API docs for the error code in the message.

Example fix

# before
results = retriever.search(max_results=10)

# after
try:
    results = retriever.search(max_results=10)
except Exception as e:
    logger.warning(f"fastCRW search failed: {e}")
    results = []
Defensive patterns

Strategy: fallback

Validate before calling

null

Type guard

null

Try / catch

try:
    results = retriever.search(max_results=10)
except Exception as e:
    logger.warning(f"fastCRW error: {e}")
    results = fallback_retriever.search(max_results=10)

Prevention

When it happens

Trigger: Calling search() → _search() which POSTs/GETs the fastCRW endpoint; response.raise_for_status() passes, but results.get("success") is False.

Common situations: Invalid/expired fastCRW credentials, quota exceeded, malformed query params, or an upstream fastCRW service error — all reported via the envelope rather than an HTTP status code.

Related errors


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