Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Environment:AI4Finance Foundation FinGPT Requests

From Leeroopedia
Knowledge Sources
Domains HTTP_Client, Web_Scraping
Last Updated 2026-10-18 00:00 GMT

Overview

Python `requests` HTTP library used for all HTTP-based data fetching and web scraping across FinGPT subprojects, including anti-bot request handling, earnings call transcript fetching, and Eastmoney news downloading.

Description

This environment covers the `requests` library dependency used by implementations that perform HTTP GET/POST requests to external APIs and web pages. The RAG multisource retrieval subproject uses a `requests_url` helper that wraps `requests` with rotating user-agent headers and proxy support for anti-bot evasion. The earnings call transcript fetcher, Eastmoney downloaders, and sentence processor all use `requests` for their HTTP operations.

Usage

Use this environment for any implementation that fetches data via HTTP requests. Required by anti-bot HTTP request helpers, earnings call transcript fetchers, Eastmoney news downloaders, proxy header rotation, and sentence processing implementations.

System Requirements

Category Requirement Notes
OS Any Cross-platform
Hardware CPU sufficient No GPU needed
Network Internet Required for fetching external data

Dependencies

Python Packages

  • `requests` >= 2.31.0
  • `fake-useragent` (optional, for header rotation)

Credentials

No credentials required for the library itself. Individual implementations may require API keys (e.g., Finnhub, OpenAI).

Quick Install

pip install "requests>=2.31.0"

Code Evidence

Anti-bot request helper from `fingpt/FinGPT_RAG/multisource_retrieval/requests_url.py`:

import requests

def requests_get(url, headers=None, timeout=10):
    """GET request with rotating user-agent headers."""
    if headers is None:
        headers = get_random_headers()
    return requests.get(url, headers=headers, timeout=timeout)

Common Errors

Error Message Cause Solution
`ConnectionError` Network issue or site down Add retry logic with backoff
`HTTP 403 Forbidden` Anti-bot blocking Use rotating headers and proxies
`SSLError` Certificate verification issue Check system CA certificates

Compatibility Notes

  • Session reuse: Use `requests.Session()` for connection pooling across multiple requests.
  • Timeout: Always set explicit timeouts to avoid hanging on unresponsive servers.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment