I recently had the chance to speak with a statistician at the Department of Homeland Security (DHS) about my Streamlit app that visualizes trends in US Immigration Enforcement data (link). Our conversation helped clarify a question I’d raised in an earlier post—one that emerged from a surprising pattern in the data.
A Surprising Pattern
The first graph in my post showed how the number of detainees in ICE custody has changed over time, broken down by the arresting agency: ICE (Immigration and Customs Enforcement) or CBP (Customs and Border Protection). The agency-level split revealed an unexpected trend.
As I noted in the post:
Equally interesting is the agency-level data: since Trump took office ICE detentions are sharply up, but CBP detentions are down. I am not sure why CBP detentions are down.
A Potential Answer
This person suggested that CBP arrests might reflect not just enforcement capacity, but the number of people attempting to cross the border illegally—a figure that could fluctuate based on how welcoming an administration appears to be toward immigration.
This was a new lens for me. I hadn’t considered that attempted border crossings might rise or fall with shifts in presidential tone or policy. Given that one of Trump’s central campaign promises in 2024 was to crack down on illegal immigration (link), it felt like a hypothesis worth exploring.
The Data: USBP Encounters
While we can’t directly measure how many people attempt to cross the border illegally, DHS publishes a dataset that records each time the US Border Patrol (USBP) encounters a “removable alien”—a term DHS uses for individuals subject to removal under immigration law. This dataset can serve as a rough proxy for attempted illegal crossings.
The data is available on this page and is published as an Excel workbook titled “CBP Encounters – USBP – November 2024.” It covers October 1999 through November 2024, spanning five presidential administrations. While it doesn’t include data from the current administration (which began in January 2025), it does offer a historical view of enforcement trends.
The workbook contains 16 sheets; this analysis focuses on the “Monthly Region” tab. In this sheet, “Region” refers to the part of the border where the encounter occurred: Coastal Border, Northern Land Border, or Southwest Land Border.
The Analysis
To support this analysis, I created a new Python module called encounters. It’s available in my existing immigration_enforcement repo, along with the dataset and example workbooks. I’ve tagged the version of the code used in this post as usbp_encounters_post, so people will always be able to run the examples below—even if the repo evolves. You’re welcome to clone it and use it as a foundation for your own analysis.
One important detail: this dataset records dates using fiscal years, which run from October 1 to September 30. For example, October of FY2020 corresponds to October 2019 on the calendar. To simplify analysis, the function encounters.get_monthly_region_df reads in the “Monthly Region” sheet and automatically converts all fiscal year dates to calendar dates:
To preview the data, we can load the “Monthly Region” sheet using the encounters module like this:
import encounters df = encounters.get_monthly_region_df() df.head()
This returns:
| date | region | quantity | |
|---|---|---|---|
| 0 | 1999-10-01 | Coastal Border | 740 |
| 1 | 1999-10-01 | Northern Land Border | 1250 |
| 2 | 1999-10-01 | Southwest Land Border | 87820 |
| 3 | 1999-11-01 | Coastal Border | 500 |
| 4 | 1999-11-01 | Northern Land Border | 960 |
To visualize the data, we can use Plotly to create a time series of encounters by region:
import plotly.express as px
px.line(
df,
x="date",
y="quantity",
color="region",
title="USBP Border Encounters Over Time",
color_discrete_sequence=px.colors.qualitative.T10,
)
From this graph, a few patterns stand out:
- Encounters are overwhelmingly concentrated at the Southwest Land Border.
- Until around 2015, the data shows a strong seasonal rhythm, typically dipping in December and peaking in March.
- After 2015, variability increases sharply, with both the lowest (2017) and highest (2023) values occurring in this period.
A Better Graph
Since the overwhelming majority of encounters occur at the Southwest Land Border, it makes sense to focus the visualization there. To explore how encounter trends align with presidential transitions, we can annotate the graph to show when administrations changed. The function encounters.get_monthly_encounters_graph handles this:
encounters.get_monthly_encounters_graph(annotate_administrations=True)
This annotated graph appears to support what the DHS statistician suggested: encounter numbers sometimes shift dramatically between administrations. The change is especially pronounced for the Trump and Biden administrations:
- The lowest value (April 2017) occurred shortly after Trump took office.
- The transition from Trump to Biden marks one of the sharpest increases in the dataset.
- The highest value (December 2023) occurred during Biden’s administration.
Potential Policy Link
While I’m not an expert on immigration policy, Wikipedia offers summaries of the immigration policies under both the Trump and Biden administrations.
It describes Trump’s policies as aiming to reduce both legal and illegal immigration—through travel bans, lower refugee admissions, and stricter enforcement measures. And the page on Biden’s immigration policy begins:
“The immigration policy Joe Biden initially focused on reversing many of the immigration policies of the previous Trump administration.”
The contrast between these two approaches is stark, and it’s at least plausible that the low number of encounters at the start of Trump’s first term, and the spike in encounters at the start of Biden’s term, reflect responses to these shifts.
Future Work
This post is just a first step in analyzing Border Patrol Encounter data. Looking ahead, here are a few directions I’m excited to explore:
- Integrate this graph into my existing Immigration Enforcement Streamlit app (link).
- Incorporate more timely data. While this dataset is only published annually, DHS appears to release monthly updates here. Finding a way to surface those numbers in the app would make it more responsive to current trends.
- Explore other dimensions of the dataset. Beyond raw encounter counts, the data includes details like citizenship, family status, and where encounters happen. These facets could offer deeper insight into enforcement patterns and humanitarian implications.
While comments on my blog are disabled, I welcome hearing from readers. You can contact me here.
