Technical writing

FARA: The Foreign Agents Registration Act Database Behind Lobbying Disclosure for Foreign Governments

· AI Analytics
FARAForeign AgentsLobbyingNational SecurityFederal Data

The Foreign Agents Registration Act has spent most of its eighty-year existence as the federal government's most underenforced disclosure law—a statute with felony penalties, sweeping scope, and almost no prosecution. That changed after 2016. A surge of criminal cases, retroactive registrations, and DOJ Inspector General criticism transformed FARA from a largely ignored paperwork regime into the centerpiece of national security enforcement against foreign influence operations. The Electronic Reading Room at justice.gov/nsd-fara now contains over eighty years of registration filings, disbursement statements, and political activity disclosures, making it one of the most detailed public windows into the infrastructure of foreign government influence in the United States.

Origins and statutory framework

Congress enacted the Foreign Agents Registration Act in 1938, responding directly to the discovery of organized Nazi and Soviet propaganda operations in the United States. The House Special Committee on Un-American Activities, chaired by Martin Dies, had documented a network of German government-funded propaganda agents operating through domestic front organizations, placing pro-Nazi content in American newspapers, organizing rallies, and cultivating relationships with members of Congress without disclosing their foreign government funding. The statute that emerged required anyone acting as an agent of a foreign principal in political or quasi-political capacities to register with the Department of Justice and publicly disclose the nature of that relationship.

The governing statute is codified at 22 U.S.C. §§ 611–621. The definitional architecture is central to understanding FARA's scope and limits. A “foreign principal” is defined to include foreign governments, foreign political parties, any person outside the United States (with some exceptions), and any entity organized under the laws of or having its principal place of business in a foreign country. A “foreign agent” is a person who acts at the order, request, or under the direction or control of a foreign principal, or whose activities are directly or indirectly supervised, directed, controlled, financed, or subsidized in whole or in part by a foreign principal, and who engages in political activities, lobbying, public relations, dissemination of political propaganda, or representation of a foreign government before a US agency or official.

The breadth of the “direction or control” language is what gives FARA its prosecutorial reach beyond the most obvious cases. An American consulting firm retained by a Gulf state sovereign wealth fund to produce favorable policy research and place op-eds in Washington publications can fall within FARA's coverage even without a formal agency relationship, if the activities are done at the request of and financially supported by the foreign entity. Whether a given relationship crosses the FARA threshold has generated substantial litigation and advisory opinion practice, particularly given the availability of the Lobbying Disclosure Act exemption discussed below.

Administration of FARA is vested in the National Security Division of the Department of Justice, specifically the FARA Unit within NSD's Counterintelligence and Export Control Section. The FARA Unit reviews filings for completeness, issues advisory opinions on whether specific proposed activities trigger registration obligations, and refers cases to NSD's prosecution component or to the FBI for criminal investigation when willful non-registration is suspected. The Unit maintains the public database and can initiate civil enforcement actions seeking injunctions requiring retroactive registration.

Registration mechanics: Form RA-1 and the supplement cycle

An agent required to register must do so within ten days of beginning activities on behalf of a foreign principal. The initial registration is submitted on Form RA-1, which requires disclosure across several categories: the registrant's identity and business structure; the identity of each foreign principal for whom the registrant is acting; the nature of the relationship between the registrant and each foreign principal, including the terms of any written agreement; a description of the registrant's activities on behalf of the foreign principal; the amount of compensation received or to be received; any political activities performed or to be performed, including contacts with government officials; any disbursements made or expected to be made in connection with those activities; and copies of any written agreements with the foreign principal.

FARA imposes a continuous disclosure obligation through mandatory semi-annual supplement filings on Form NSD-3. Every six months, a registered agent must file a supplement covering the preceding period that includes: updated descriptions of activities performed for each foreign principal; a complete accounting of compensation received; an itemized statement of disbursements made in connection with FARA-covered activities; a list of all political propaganda disseminated or caused to be disseminated; and a detailed account of any contacts with government officials, including the name of the official, the date, the subject matter, and the registrant's purpose. The specificity of required contact disclosures—naming the specific members of Congress or executive branch officials contacted, the dates, and the subjects discussed—is what gives FARA filings their analytical value for tracking foreign government access to American policymakers.

Exhibit A must be filed with the initial registration and updated whenever a material change occurs. Exhibit A identifies each foreign principal by name, address, country, and type (government ministry, state-owned enterprise, political party, private corporation, individual), and describes the nature and purpose of the registrant-principal relationship. Exhibit B discloses the activities the registrant has performed or will perform, including a breakdown of lobbying, public relations, media placement, political fundraising, and direct government contacts. Statements of disbursements account for expenditures in categories including salaries, office expenses, advertising, travel, and payments to third parties.

DOJ launched the eFARA electronic filing system in 2016, making electronic submission mandatory for all new registrations and supplements. Prior to eFARA, registrations were submitted on paper and scanned into the database with varying quality. The eFARA system at efile.fara.gov provides a searchable interface and serves as the backend for the bulk data exports that enable programmatic analysis. All documents filed through eFARA are automatically posted to the Electronic Reading Room within days of filing.

Exemptions: diplomatic officials, bona fide activities, and the LDA

FARA's exemptions are as consequential as the registration requirement itself. Three statutory exemptions cover the bulk of entities that might otherwise fall within the statute's scope.

The diplomatic and consular exemption covers officials of foreign governments who are duly accredited and recognized by the State Department as diplomatic or consular officers. Their activities in their official capacity are excluded from FARA registration, as those activities are separately regulated under the Vienna Convention on Diplomatic Relations. This exemption does not cover unofficial representatives, consultants retained by embassies, or former diplomats acting in non-official capacities.

The bona fide exemption at 22 U.S.C. § 613(e) excludes persons whose activities on behalf of a foreign principal are “in furtherance of bona fide religious, scholastic, academic, or scientific pursuits or of the fine arts.” This exemption covers academic researchers collaborating with foreign universities on scientific projects, visiting scholars at American institutions funded by foreign governments, and cultural exchange programs. The exemption became contested during the DOJ China Initiative period (2018–2022), when the government scrutinized whether Chinese government-funded researchers at American universities fell within the bona fide academic exemption or were engaged in activities sufficiently political to require FARA registration.

The Lobbying Disclosure Act exemption at 22 U.S.C. § 613(h) is the most heavily used and the most controversial. It exempts from FARA registration any person who is registered under the Lobbying Disclosure Act of 1995, provided that the foreign principal is not a foreign government or foreign political party. This exemption created a significant regulatory gap: many entities that are functionally agents of foreign government interests—sovereign wealth funds, state-owned enterprises, government-controlled media organizations, and foundations with government funding—could avoid FARA by characterizing their principals as non-governmental, registering under LDA instead, and operating under a dramatically less demanding disclosure regime.

The substantive difference between FARA and LDA disclosure is significant. LDA registrants disclose lobbying contacts and expenditures quarterly at a high level of aggregation, without itemizing specific Congressional contacts by name, date, and subject. FARA registrants must disclose exactly which government officials they contacted, when, and about what, every six months. A Saudi-funded Washington lobbying firm registered under LDA discloses far less about its congressional access than the same firm would disclose under FARA.

The 2016 inflection: DOJ IG criticism and enforcement surge

For most of FARA's history, criminal enforcement was nearly nonexistent. Between 1966 and 2015—a period spanning nearly fifty years—the DOJ brought exactly seven FARA prosecutions. The statute was widely understood among Washington lobbying attorneys as a compliance formality with minimal enforcement risk; the FARA Unit's historical practice was to contact non-registrants by letter, request voluntary registration, and close matters without prosecution once retroactive registration occurred. This approach was documented and criticized by the DOJ Office of Inspector General in a September 2016 report, which found that the FARA Unit lacked clear investigative procedures, relied excessively on voluntary compliance, did not systematically identify potential violations, and had not developed adequate case-tracking systems.

The 2016 OIG report established the institutional predicate for a shift in enforcement posture that the Mueller investigation then dramatically accelerated. Special Counsel Robert Mueller's team used FARA as both a substantive charge and a pressure tool in ways that transformed the statute's profile in Washington compliance practice. The highest-profile case involved Paul Manafort and Richard Gates, who were charged in October 2017 with conspiracy against the United States, money laundering, and failure to register as foreign agents under FARA based on their work for Ukrainian political parties and oligarchs between 2006 and 2015. Manafort was convicted on eight counts at trial in August 2018 and subsequently pleaded guilty to the FARA conspiracy count. Gates pleaded guilty and cooperated with prosecutors. The Manafort prosecution was the first major FARA conviction in decades and signaled that DOJ was prepared to use the statute as a primary charge rather than a supplementary allegation.

Michael Flynn, Trump's first National Security Advisor, retroactively registered under FARA in March 2017 for lobbying work performed in 2016 by his consulting firm Flynn Intel Group on behalf of a Turkish government-linked entity. Flynn had failed to register during the campaign, including during the period when he was serving as a Trump foreign policy advisor. The retroactive FARA filing disclosed $530,000 in payments from Inovo BV, a Dutch company with ties to Turkish government officials, and documented meetings with DOJ and US intelligence officials about Fethullah Gülen, the Pennsylvania-based cleric whose extradition Turkey had sought. Bijan Kian, Flynn's former business partner, was indicted on FARA charges but the conviction was vacated on appeal.

Tom Barrack, a longtime Trump associate and chairman of the 2017 inaugural committee, was indicted in 2021 on charges of acting as an unregistered foreign agent of the UAE and failing to register under FARA. The indictment alleged that Barrack had worked to advance UAE foreign policy interests within the Trump campaign and administration beginning in 2016. Barrack was acquitted by a jury in November 2022, a significant setback for FARA criminal enforcement that illustrated the evidentiary difficulty of proving “direction or control” beyond reasonable doubt. Tony Podesta, a Washington lobbying figure whose firm had performed work related to Ukraine policy during the Manafort period, retroactively registered under FARA in 2017 following Mueller investigation pressure but was never charged criminally. Elliott Broidy, a Republican fundraiser, retroactively registered under FARA in 2020 for work he performed on behalf of the Malaysian and Chinese governments.

The FARA Electronic Reading Room

The FARA Electronic Reading Room at justice.gov/nsd-fara/fara-electronic-reading-room is the primary public access point for registration documents, amendments, and supplements. All registrations filed since approximately 2007 are available in electronic form through the Reading Room; filings from 1942 through the early 2000s were digitized from paper records and are available as scanned PDFs with varying OCR quality. The eFARA electronic filing system post-2016 provides machine-readable filings that are substantially more useful for programmatic analysis.

The Reading Room search interface allows querying by registrant name, foreign principal name, country, registration number, and date range. Individual document pages provide direct PDF download links for each filing. The database includes initial registrations (Form RA-1), six-month supplements (Form NSD-3), amendments, exhibit filings, termination notices, and exemption claims. The eFARA bulk export at efile.fara.gov/bulk/ provides CSV downloads of the core structured data tables: the registrant table, the foreign principal table, the exhibits table, and the disbursements and receipts table. These CSV files are updated periodically by the FARA Unit and collectively represent the machine-readable core of the database.

Approximately 500 to 600 active registrations exist at any point in time, representing firms and individuals currently performing FARA-covered activities for foreign principals. The all-time database contains several thousand registrant records spanning eighty years of activity. The countries generating the largest numbers of active registrations consistently include Saudi Arabia, the United Arab Emirates, Turkey, Israel, Qatar, and Japan; China's position in the active registration counts shifted significantly following DOJ's China Initiative enforcement actions. Countries with state-controlled media organizations or active government communications programs—Russia, China, Iran—appear in the registration database through their state media entities, though Russia's presence dropped sharply after RT (Russia Today) and TASS were required to register in 2017 and subsequently reduced US operations.

The major Washington lobbying and public relations firms that dominate FARA registrations include Squire Patton Boggs, BGR Group, Mercury LLC, Ballard Partners, Brownstein Hyatt Farber Schreck, and Akin Gump Strauss Hauer & Feld. These firms represent the highest-dollar foreign government accounts, and their FARA supplements provide the most granular disclosure of congressional and executive branch contacts. Individual registrations by former senior government officials represent a distinct and high-profile category: former members of Congress, ambassadors, and senior White House staff who move into foreign government advisory work are required to register if their activities meet the FARA threshold, and their registrations document the monetization of government relationships in detail.

Saudi Arabia: lobbying disclosure after Khashoggi

The murder of journalist Jamal Khashoggi at the Saudi consulate in Istanbul on October 2, 2018 focused unusual public attention on Saudi Arabia's FARA filings, which document the scale and sophistication of Saudi government influence operations in the United States. Saudi Arabia had been among the largest FARA spenders for years before the Khashoggi murder; the subsequent congressional pressure and public scrutiny transformed those filings into a major accountability mechanism.

Saudi Arabia's FARA-registered lobbying expenditures exceeded $14 million annually in the years following the Khashoggi murder, with total disclosed spending since 2016 exceeding $450 million when all registered firms are aggregated. The firms retained include Squire Patton Boggs (one of the largest FARA billers over the period), Akin Gump Strauss Hauer & Feld, BGR Group, and Brownstein Hyatt. FARA supplements from these firms disclose the specific activities performed on Saudi Arabia's behalf in remarkable detail: congressional outreach by member name, dates, and subjects discussed; op-ed placements in major newspapers; media training for Saudi officials visiting Washington; arrangements for editorial board meetings at major publications; event sponsorships at Washington think tanks; and the preparation of policy memoranda circulated to administration officials and congressional staff.

The think tank disbursement disclosures are particularly significant. FARA supplements from Saudi-registered firms include itemized payments to Washington policy organizations for event sponsorship, research support, and speaker arrangements. These disclosures established that Saudi government funds were flowing to several prominent Washington foreign policy and security research institutions during the period of peak Saudi public relations effort, providing a documentary record that became significant in congressional debates over Saudi Arabia policy and arms sales. The specificity of FARA's disbursement disclosure—requiring itemized payments above specified thresholds to named recipients—makes it a substantially more granular record of think tank foreign government funding than any other public disclosure mechanism.

FARA supplements from Saudi-registered lobbyists document contacts with members of the Senate Foreign Relations Committee, the House Armed Services Committee, and senior National Security Council staff regarding the Khashoggi investigation, the administration's intelligence assessment attributing responsibility to Crown Prince Mohammed bin Salman, proposed arms sales restrictions, and the Yemen War Powers Act legislation. The breadth of the congressional outreach documented in these filings—identifying by name dozens of senators, representatives, and staff contacted over six-month periods—provides a granular map of Saudi government access to US policymakers unavailable through any other public source.

China FARA enforcement and the China Initiative

DOJ launched the China Initiative in November 2018, a coordinated enforcement program targeting Chinese economic espionage, technology theft, and foreign influence operations. The China Initiative had a direct FARA dimension: the program increased DOJ scrutiny of Chinese government-linked entities operating in the United States without FARA registration, and generated a series of enforcement actions and registration demands that reshaped the compliance landscape for Chinese government-affiliated organizations.

Chinese state media presented the most straightforward cases. China Global Television Network (CGTN), the international English-language broadcaster controlled by the Chinese Communist Party through China Media Group, registered as a foreign agent under FARA in February 2019 following DOJ pressure. Xinhua News Agency, the official Chinese state news service, registered in August 2018. These registrations required CGTN and Xinhua to disclose their funding sources, editorial relationships with the Chinese government, and US activities including congressional contacts and media operations. The CGTN and Xinhua FARA supplements provide documentary evidence of Chinese state media's US operational structure not available from any other public source.

Confucius Institutes—Chinese-government-funded cultural and language programs hosted at American universities and administered by Hanban (now the Center for Language Education and Cooperation), an agency under China's Ministry of Education—presented a more contested FARA question. Several Confucius Institute host organizations were examined under the China Initiative framework, though the bona fide academic exemption complicated the FARA analysis for purely educational activities. Congressional pressure, including provisions in the National Defense Authorization Act restricting Department of Defense Chinese language funding to universities hosting Confucius Institutes without transparency measures, drove a wave of university closures that reduced the domestic Confucius Institute presence from roughly 100 institutions at peak to under 10 by 2023, largely mooting the FARA registration question through program termination.

The China Initiative was formally ended in February 2022 following criticism that it had generated racial profiling of Chinese-American researchers and had produced a high rate of failed prosecutions in academic espionage cases. The Initiative's FARA-related enforcement actions—the state media registrations and the scrutiny of educational and cultural organizations— remained in place after the Initiative's conclusion, and FARA enforcement against Chinese government-linked entities has continued under the general FARA enforcement program rather than the Initiative-specific framework.

Scale and scope: what the database contains

The FARA Electronic Reading Room contains filings extending back to 1942, representing the full statutory history of the Act's operation. Electronic filings with machine-readable data begin in earnest around 2007, with the eFARA mandatory electronic submission system producing structured data from 2016 onward. Across the full database, the registrant pool has included several thousand distinct entities and individuals over the statute's history, representing agents of foreign principals from virtually every country that has maintained diplomatic or economic relationships with the United States.

The disbursements and receipts table is the most analytically useful component of the bulk export for understanding the financial scale of foreign government influence operations. FARA-registered agents must report compensation received from foreign principals and expenditures made in connection with their FARA activities. These figures undercount actual foreign government lobbying spending significantly, because the LDA exemption removes a large share of foreign-government-adjacent spending from FARA's disclosure reach— entities characterizing their foreign principals as non-governmental register under LDA and disclose far less. The FARA disbursement figures represent spending by the subset of registrants who could not use the LDA exemption, primarily direct agents of foreign governments and foreign political parties.

The foreign principals table records every foreign entity on behalf of whom a FARA registrant has acted, with the country of the principal and the type of entity (government, political party, state-owned enterprise, private entity, individual). Linking the principals table to the disbursements table by registration number enables country-level aggregation of disclosed FARA spending—the analytical foundation for understanding which foreign governments are spending most heavily on disclosed influence activities in the United States. Saudi Arabia, the UAE, and Japan have historically led in disclosed spending when excluding state media organizations; with state media included, Russia and China appear prominently for the years when their state broadcasters were registered.

OpenSecrets, the nonpartisan campaign finance research organization, maintains a compiled FARA database aggregating registrant, principal, and financial data into a searchable interface that supplements the DOJ's own Reading Room search. The Project on Government Oversight (POGO) has conducted original analysis of FARA filings, particularly regarding the revolving door between senior government service and FARA-registered foreign agent work. ProPublica has compiled historical FARA data for investigative projects. GitHub repositories maintained by academic and civil society researchers contain scraped and processed versions of the FARA bulk data, though the DOJ's own bulk CSV exports at efile.fara.gov/bulk/ are the most reliable primary source.

Criminal enforcement and civil penalties

Willful failure to register under FARA is a federal felony under 22 U.S.C. § 618(a)(1), carrying a maximum sentence of five years imprisonment and criminal fines. Willful false statements in FARA filings are separately prosecutable under 18 U.S.C. § 1001, also a felony. The statute also provides for civil injunctive relief: the DOJ can seek a court order requiring an unregistered person to comply with the registration and disclosure requirements without pursuing criminal prosecution.

The historical pattern of enforcement has sharply favored civil over criminal remedies. The DOJ's standard practice through the Mueller era was to contact suspected non-registrants by letter, advise them of the FARA Unit's view that registration was required, and accept retroactive registration as resolution without further action. This approach was documented and criticized in the 2016 OIG report as systematically under-deterrent: the practical consequence of non-compliance was a letter and eventual voluntary registration, creating no meaningful incentive to file on time or file at all. The OIG estimated that the number of entities actually required to register substantially exceeded the number registered at any time, with the gap maintained by the combination of low enforcement probability and the substantial compliance burden of ongoing supplement filing.

The post-Mueller enforcement posture changed this calculus materially. Criminal FARA charges against Manafort and Gates, the retroactive registration pressure on Flynn, Podesta, and others, and the Barrack prosecution demonstrated DOJ's willingness to use FARA as a primary charge rather than a supplementary allegation in cases involving sufficiently high-profile or politically significant foreign influence activity. The pattern that emerged from the 2017–2022 enforcement surge suggests that DOJ treats criminal FARA prosecution as appropriate when: the failure to register involves sustained, high-dollar activity over multiple years; the registrant had legal counsel who could be presumed to have identified the FARA issue; the activity involves a foreign principal of national security significance; and the FARA charge can be combined with financial crimes or false statement charges to construct a coherent prosecutorial narrative.

The Barrack acquittal in 2022 introduced significant uncertainty into this post-Mueller posture. The jury's rejection of the government's FARA theory—that Barrack had acted under UAE direction and control— illustrated the difficulty of proving the statutory elements beyond reasonable doubt when the foreign relationship involves informal consultations, shared policy interests, and ambiguous communications rather than explicit tasking. FARA cases where the foreign principal relationship is documented by formal contracts, wire transfers, and explicit direction (Manafort, Gates) are substantially stronger than cases where the government must infer direction from patterns of communication and shared interest (Barrack). This distinction has implications for prosecutorial targeting: the Barrack acquittal reinforced the importance of documentary evidence of explicit foreign principal tasking to FARA criminal prosecution.

Data access and programmatic analysis

The primary programmatic access point for FARA data is the eFARA bulk export at efile.fara.gov/bulk/. The bulk export provides three principal CSV files: FARA_All_Registrants.csv contains one row per registrant with name, address, registration number, status (active or terminated), registration date, and termination date. FARA_All_ForeignPrincipals.csv contains one row per foreign principal-registrant relationship, with the principal's name, country, entity type, and associated registration number. FARA_All_DisbursementsReceipts.csv contains itemized financial disclosures with registration number, document date, amount, and disbursement category. The DOJ does not provide an official API for programmatic document access; the bulk CSV export is the sanctioned primary channel.

The bulk CSV files do not contain the full text of exhibit filings, contact disclosure statements, or political activity narratives. For that content, researchers must access individual PDF documents through the FARA Electronic Reading Room interface. Several GitHub repositories maintain scrapers for the Reading Room PDF index, enabling bulk download of exhibit documents for text analysis. FOIA requests to the FARA Unit can yield additional materials not available through the public Electronic Reading Room: internal advisory opinions issued to registrants on whether specific activities require registration; correspondence between the FARA Unit and registrants regarding compliance issues; and case files for enforcement matters. The FARA Unit has historically been responsive to FOIA requests for advisory opinion letters, which collectively constitute an informal body of FARA interpretive guidance.

Python example: analyzing FARA disbursements by country

The following script downloads three FARA bulk CSV files from efile.fara.gov/bulk/, links registrant records to foreign principal countries, and computes four analyses: active registrations by country of foreign principal; total FARA disbursements by country for the 2015–2024 period; an annual spending timeline showing year-over-year trends in disclosed FARA financial activity; and a registrant type classification using name-based heuristics to distinguish law firms, PR firms, consulting entities, and individuals. No API key is required. The disbursements file can be large—several hundred megabytes for a full historical export—so the script uses a 180-second download timeout and brief rate-limiting pauses between requests.

import csv
import time
import urllib.request
from collections import defaultdict
from datetime import datetime

# ---------------------------------------------------------------------------
# FARA Electronic Reading Room: registrant and disbursement analysis
# Public database: https://www.justice.gov/nsd-fara/fara-electronic-reading-room
# FARA bulk data (CSV): https://efile.fara.gov/bulk/
# eFARA filing search: https://efile.fara.gov/ords/fara/f?p=171
# No API key required. Rate-limit your requests.
# ---------------------------------------------------------------------------

BULK_BASE = "https://efile.fara.gov/bulk/"

# FARA bulk export file names (updated periodically by DOJ/NSD)
BULK_FILES = {
    "registrants":   "FARA_All_Registrants.csv",
    "principals":    "FARA_All_ForeignPrincipals.csv",
    "disbursements": "FARA_All_DisbursementsReceipts.csv",
}


def fetch_csv(filename: str) -> list[dict]:
    """Download a FARA bulk CSV and return as a list of row dicts."""
    url = BULK_BASE + filename
    print(f"  Downloading {filename} ...")
    req = urllib.request.Request(
        url,
        headers={"User-Agent": "fara-analysis/1.0 (research; contact@example.com)"},
    )
    with urllib.request.urlopen(req, timeout=180) as resp:
        lines = resp.read().decode("utf-8-sig").splitlines()
    reader = csv.DictReader(lines)
    rows = list(reader)
    print(f"    Loaded {len(rows):,} rows.")
    return rows


def parse_amount(val: str | None) -> float:
    """Parse a dollar amount string like '$1,234,567.89' to float."""
    if not val:
        return 0.0
    cleaned = val.replace("$", "").replace(",", "").strip()
    try:
        return float(cleaned)
    except (ValueError, TypeError):
        return 0.0


def parse_year(date_str: str | None) -> int | None:
    """Extract year from date strings in various formats."""
    if not date_str:
        return None
    for fmt in ("%m/%d/%Y", "%Y-%m-%d", "%m-%d-%Y"):
        try:
            return datetime.strptime(date_str.strip(), fmt).year
        except (ValueError, TypeError):
            continue
    return None


def main() -> None:
    # ------------------------------------------------------------------
    # 1. Active registrants by country of foreign principal
    # ------------------------------------------------------------------
    print("\n=== Fetching FARA registrant and principal data ===")
    registrants = fetch_csv(BULK_FILES["registrants"])
    principals  = fetch_csv(BULK_FILES["principals"])
    time.sleep(1)

    # Build a map: registration_number -> country
    reg_country: dict[str, str] = {}
    for row in principals:
        reg_no  = (row.get("Registration_Number") or "").strip()
        country = (row.get("Country_Name") or "Unknown").strip()
        if reg_no:
            reg_country[reg_no] = country

    # Count active registrants by country
    country_active: dict[str, int] = defaultdict(int)
    country_all: dict[str, int] = defaultdict(int)
    for row in registrants:
        reg_no = (row.get("Registration_Number") or "").strip()
        status = (row.get("Registration_Status") or "").strip().upper()
        country = reg_country.get(reg_no, "Unknown")
        country_all[country] += 1
        if status == "ACTIVE":
            country_active[country] += 1

    print("\n=== Top-15 Countries by Active FARA Registrations ===")
    print(f"  {'Country':<35}  {'Active':>8}  {'All-Time':>10}")
    print("  " + "-" * 60)
    sorted_active = sorted(country_active.items(), key=lambda x: x[1], reverse=True)
    for country, active in sorted_active[:15]:
        all_time = country_all.get(country, 0)
        print(f"  {country:<35}  {active:>8,}  {all_time:>10,}")

    # ------------------------------------------------------------------
    # 2. Total disbursements by country of foreign principal (2015-2024)
    # ------------------------------------------------------------------
    print("\n=== Fetching FARA disbursements and receipts data ===")
    disbursements = fetch_csv(BULK_FILES["disbursements"])
    time.sleep(1)

    country_spend: dict[str, float] = defaultdict(float)
    year_spend: dict[int, float] = defaultdict(float)

    for row in disbursements:
        reg_no  = (row.get("Registration_Number") or "").strip()
        amount  = parse_amount(row.get("Amount"))
        yr      = parse_year(row.get("Date"))
        country = reg_country.get(reg_no, "Unknown")

        if yr and 2015 <= yr <= 2024:
            country_spend[country] += amount
            year_spend[yr] += amount

    print("\n=== Top-20 Foreign Principals by Total FARA Disbursements (2015-2024) ===")
    print(f"  {'Country':<35}  {'Total Disbursements':>22}")
    print("  " + "-" * 62)
    sorted_spend = sorted(country_spend.items(), key=lambda x: x[1], reverse=True)
    for country, total in sorted_spend[:20]:
        print(f"  {country:<35}  ${total:>21,.0f}")

    # ------------------------------------------------------------------
    # 3. Annual FARA spending timeline (all countries combined)
    # ------------------------------------------------------------------
    print("\n=== Annual FARA Disbursements Timeline (2015-2024) ===")
    print(f"  {'Year':>6}  {'Total Reported':>18}  Bar")
    print("  " + "-" * 60)
    for yr in sorted(year_spend):
        total = year_spend[yr]
        bar   = "=" * int(total / 5_000_000)
        print(f"  {yr:>6}  ${total:>17,.0f}  {bar}")

    # ------------------------------------------------------------------
    # 4. Registrant type analysis: law firms, PR firms, individuals
    # ------------------------------------------------------------------
    print("\n=== Registrant Type Distribution ===")
    type_counter: dict[str, int] = defaultdict(int)
    for row in registrants:
        name_upper = (row.get("Registrant_Name") or "").upper()
        if any(k in name_upper for k in ["LLP", "LAW", "ATTORNEY", "COUNSEL", "LEGAL"]):
            category = "Law Firm / Attorney"
        elif any(k in name_upper for k in ["PR", "PUBLIC RELATIONS", "COMMUNICATIONS", "MEDIA"]):
            category = "PR / Communications Firm"
        elif any(k in name_upper for k in ["LLC", "INC", "CORP", "CONSULTING", "GROUP"]):
            category = "Consulting / Corporate"
        else:
            category = "Individual / Other"
        type_counter[category] += 1

    for category, count in sorted(type_counter.items(), key=lambda x: x[1], reverse=True):
        share = count / len(registrants) * 100 if registrants else 0
        print(f"  {category:<35}  {count:>6,}  ({share:.1f}%)")

    print(f"\n  Total registrant records analyzed: {len(registrants):,}")
    print(f"  Disbursement records analyzed:      {len(disbursements):,}")
    print(f"  Date range filtered:                2015-2024")


if __name__ == "__main__":
    main()

Running this script against the live bulk exports will typically show Saudi Arabia, the UAE, Japan, Turkey, and Israel among the top countries by both active registrations and total disbursements. The annual timeline will show a visible surge in disclosed spending in the 2018–2022 period corresponding to both the increased enforcement posture driving new registrations and the Saudi Arabia post-Khashoggi lobbying escalation. The law firm and PR firm categories will account for the large majority of registrant entities by count, with individual registrations representing a numerically smaller but often higher-profile share that includes former senior government officials. Any country with both high active registration counts and high per-registrant disbursements is running a sustained, professionally managed influence operation—a combination that distinguishes countries engaged in strategic government relations programs from those with episodic or reactive US lobbying activity. Bear in mind throughout that the figures represent a floor: the LDA exemption excludes a structurally unmeasurable share of foreign-government-adjacent lobbying from the FARA database entirely.

For the DOJ Antitrust Division enforcement database that shares FARA's institutional home in the Department of Justice—including the criminal leniency program, HSR pre-merger notification filings, and the Sherman Act enforcement data accessible through ATR press releases and court records—see DOJ Antitrust Division: The Federal Merger Review and Cartel Enforcement Database, covering prosecutorial mechanics, HHI concentration thresholds, and programmatic access to DOJ enforcement action data.

For the Congressional Research Service reports that provide the most authoritative nonpartisan legal and policy analysis of FARA's statutory scope, the LDA exemption controversy, and the history of FARA enforcement actions—CRS Legal Sidebars on FARA have been published following each major enforcement development since 2017—see CRS Reports: The Congressional Research Service Database Behind US Policy Analysis, covering the public access mandate, EveryCRSReport.com bulk API, and product types from full Reports to Legal Sidebars.