Skip to main content

flyr/
lib.rs

1pub mod error;
2pub mod fetch;
3pub mod mcp;
4pub mod model;
5pub mod parse;
6pub mod proto;
7pub mod query;
8pub mod table;
9
10use error::FlightError;
11use fetch::FetchOptions;
12use model::SearchResult;
13use query::{QueryParams, SearchQuery};
14
15pub async fn search(
16    query: SearchQuery,
17    options: FetchOptions,
18) -> Result<SearchResult, FlightError> {
19    let params = query.to_url_params();
20    let html = fetch::fetch_html(&params, &options).await?;
21    parse::parse_html(&html)
22}
23
24pub fn generate_browser_url(params: &QueryParams) -> String {
25    query::to_google_flights_url(params)
26}