{"id":45356420,"url":"https://github.com/rempsyc/flightanalysis","last_synced_at":"2026-02-21T13:04:52.949Z","repository":{"id":323387494,"uuid":"1093051192","full_name":"rempsyc/flightanalysis","owner":"rempsyc","description":"R package to scrape flight data from Google Flights and analyzes prices. Can determine optimal flight from date, place, and price","archived":false,"fork":false,"pushed_at":"2025-12-02T05:06:26.000Z","size":5373,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-04T08:18:59.855Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rempsyc.github.io/flightanalysis/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rempsyc.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"rempsyc"}},"created_at":"2025-11-09T20:09:05.000Z","updated_at":"2025-12-02T05:00:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rempsyc/flightanalysis","commit_stats":null,"previous_names":["rempsyc/flight-analysis","rempsyc/flightanalysis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rempsyc/flightanalysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rempsyc%2Fflightanalysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rempsyc%2Fflightanalysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rempsyc%2Fflightanalysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rempsyc%2Fflightanalysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rempsyc","download_url":"https://codeload.github.com/rempsyc/flightanalysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rempsyc%2Fflightanalysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29681468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T12:30:22.644Z","status":"ssl_error","status_checked_at":"2026-02-21T12:29:55.402Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-21T13:04:52.071Z","updated_at":"2026-02-21T13:04:52.943Z","avatar_url":"https://github.com/rempsyc.png","language":"R","funding_links":["https://github.com/sponsors/rempsyc"],"categories":[],"sub_categories":[],"readme":"---\noutput: \n  github_document\n---\n\n# Flight Analysis: Find the best flights\n\nAn R package for analyzing, forecasting, and collecting flight data and prices from Google Flights. \n\n## Features\n\n- Detailed scraping and querying tools for Google Flights using chromote\n- Support for multiple trip types: one-way, round-trip, chain-trip, and perfect-chain\n- Flexible date search across multiple airports and date ranges\n- Summary tables showing prices by city and date\n- Automatic identification of cheapest travel dates\n- Visualization functions for price trends and best dates\n\n## Installation\n\nYou can install the development version of flightanalysis from GitHub:\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n```{r install, eval=FALSE}\ninstall.packages('flightanalysis', \n  repos = c('https://rempsyc.r-universe.dev', 'https://cloud.r-project.org'))\n\n# Or if you need the version from the last hour, install through `remotes`\n# install.packages(\"remotes\")\nremotes::install_github(\"rempsyc/flightanalysis\")\n```\n\n## Usage\n\n### Loading the Package\n\n```{r library, eval=TRUE}\nlibrary(flightanalysis)\n```\n\n### Creating Flight Queries and Fetching the Data\n\nThe main scraping function that makes up the backbone of most functionalities is `fa_define_query()`. It serves as a data object, preserving the flight information as well as meta-data from your query. `fa_fetch_flights()` then fetches flight information from that query. Origin and destination airports can be specified as a mix of Airport 3-letter codes, city 3-letter codes, or city names.\n\n```{r fa_define_query, eval=TRUE}\n# Round-trip\nquery \u003c- fa_define_query(\"NYC\", \"London\", \"2025-12-20\", \"2026-01-05\")\n\n# Same as:\nquery \u003c- fa_define_query(\"New York\", \"LON\", \"2025-12-20\", \"2026-01-05\")\nquery\n\n# Fetch the flight data\nflights \u003c- fa_fetch_flights(query)\n\n# View the flight data\nhead(flights$data[1:11]) |\u003e\n  knitr::kable()\n```\n\nThe package supports multiple trip types:\n\n- **One-way**: `fa_define_query(\"JFK\", \"IST\", \"2025-07-20\")`\n- **Round-trip**: `fa_define_query(\"JFK\", \"IST\", \"2025-07-20\", \"2025-08-20\")`\n- **Chain-trip**: `fa_define_query(\"JFK\", \"IST\", \"2025-08-20\", \"RDU\", \"LGA\", \"2025-12-25\")`\n- **Perfect-chain**: `fa_define_query(\"JFK\", \"2025-09-20\", \"IST\", \"2025-09-25\", \"JFK\")`\n\n## Flexible Date Search\n\nThe package supports flexible date search across multiple airports and dates:\n\n```{r fa_define_query_range, eval=TRUE}\n# Create query objects for multiple origins and dates\nqueries \u003c- fa_define_query_range(\n  origin = c(\"BOM\", \"DEL\"),\n  dest = \"JFK\",\n  date_min = \"2025-12-18\",\n  date_max = \"2025-12-22\"\n)\n\n# Fetch all flights\nflights \u003c- fa_fetch_flights(queries, verbose = FALSE)\n\n# Create summary table (City × Date with prices)\nfa_summarize_prices(flights) |\u003e\n  knitr::kable()\n\n# Find the cheapest dates\nfa_find_best_dates(\n  flights, \n  n = 5,\n  by = \"min\",\n  price_max = 1400,\n  max_stops = 1,\n  travel_time_max = 26  # 26 hours (numeric = hours, or use \"26 hr\" format)\n  ) |\u003e\n  knitr::kable()\n```\n\n## Visualizing Price Data\n\nThe package includes plotting functions to visualize price trends and best dates:\n\n```{r plots, eval=TRUE}\n# Plot price trends across dates\nfa_plot_prices(flights, \n               title = \"Flight Prices: BOM/DEL to JFK\",\n               size_by = \"travel_time\",\n               annotate_col = \"travel_time\")\n\n# Plot best travel dates\nfa_plot_best_dates(flights)\n```\n\n## Original Python Package\n\n**Credits:** This package is an R implementation inspired by the original Python package [google-flight-analysis](https://github.com/celebi-pkg/flight-analysis) by Kaya Celebi.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frempsyc%2Fflightanalysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frempsyc%2Fflightanalysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frempsyc%2Fflightanalysis/lists"}