Crate forex_factory

Crate forex_factory 

Source
Expand description

Forex Factory Calendar Scraper Library

This library provides functionality to scrape economic event data from the Forex Factory calendar website.

§Example

use forex_factory::{CalendarService, EventQuery, Impact, Result};

async fn fetch_events() -> Result<()> {
    let service = CalendarService::new()?;

    // Get all events for this week
    let events = service.get_week_events().await?;

    // Query with filters
    let query = EventQuery::new()
        .with_currency_pair("EUR/USD")
        .with_min_impact(Impact::Medium);
    let filtered = service.query_events(&query).await?;

    Ok(())
}

Structs§

CalendarParser
Parses Forex Factory calendar HTML into structured events.
CalendarService
High-level service for fetching and querying economic events.
EconomicEvent
An economic event from the Forex Factory calendar.
EventQuery
Query parameters for filtering economic events.
HttpCalendarFetcher
Fetches the raw HTML content from Forex Factory calendar page using HTTP.

Enums§

Error
Errors that can occur when using the forex-factory library.
Impact
Impact level of an economic event on the market. Forex Factory uses Low (yellow), Medium (orange), High (red).

Functions§

resolve_currency
Resolve a currency input to its ISO 4217 code.

Type Aliases§

Result
Result type alias for forex-factory operations.