ImportanceBiliary tract cancers (BTCs) contain several actionable molecular alterations, including FGFR2, IDH1, ERBB2 (formerly HER2), and KRAS. KRAS allelic variants are found in 20% to 30% of BTCs, and multiple KRAS inhibitors are currently under clinical investigation.ObjectivesTo describe the genomic landscape, co–sequence variations, immunophenotype, genomic ancestry, and survival outcomes of KRAS-mutated BTCs and to calculate the median overall survival (mOS) for the most common allelic variants.Design, Setting, and ParticipantsThis retrospective, multicenter, pooled cohort study obtained clinical and next-generation sequencing data from multiple databases between January 1, 2017, and December 31, 2022. These databases included Princess Margaret Cancer Centre, MD Anderson Cancer Center, Foundation Medicine, American Association for Cancer Research Project GENIE, and cBioPortal for Cancer Genomics. The cohort comprised patients with BTCs who underwent genomic testing.Main Outcome and MeasureThe main outcome was mOS, defined as date of diagnosis to date of death, which was measured in months.ResultsA total of 7457 patients (n = 3773 males [50.6%]; mean [SD] age, 63 [5] years) with BTCs and genomic testing were included. Of these patients, 5813 had clinical outcome data available, in whom 1000 KRAS-mutated BTCs were identified. KRAS allelic variants were highly prevalent in perihilar cholangiocarcinoma (28.6%) and extrahepatic cholangiocarcinoma (36.1%). Thirty-six KRAS allelic variants were identified, and the prevalence rates in descending order were G12D (41%), G12V (23%), and Q61H (8%). The variant G12D had the highest mOS of 25.1 (95% CI, 22.0-33.0) months compared with 22.8 (95% CI, 19.6-31.4) months for Q61H and 17.8 (95% CI, 16.3-23.1) months for G12V variants. The majority of KRAS-mutated BTCs (98.9%) were not microsatellite instability–high and had low tumor mutational burden (ranging from a median [IQR] of 1.2 (1.2-2.5) to a mean [SD] of 3.3 [1.3]). Immune profiling through RNA sequencing of KRAS and NRAS–mutated samples showed a pattern toward a more immune-inflamed microenvironment with higher M1 macrophage activation (0.16 vs 0.12; P = .047) and interferon-γ expression compared with wild-type tumors. The G12D variant remained the most common KRAS allelic variant in all patient ancestries. Patients with admixed American ancestry had the highest proportion of G12D variant (45.0%).Conclusions and RelevanceThis cohort study found that KRAS allelic variants were relatively common and may be potentially actionable genomic alterations in patients with BTCs, especially perihilar cholangiocarcinoma and extrahepatic cholangiocarcinoma. The findings add to the growing data on genomic and immune landscapes of KRAS allelic variants in BTCs and are potentially of value to the planning of specific therapies for this heterogeneous patient group.