Abstract
It is common, both in unitary and federal countries, for politicians at different levels to cooperate in pursuit of mutual benefits. But how can we identify who cooperates with whom to investigate the factors behind these alliances? This article proposes a novel strategy to detect alliances between local executive leaders and national legislators using mayors’ social media data. Drawing on over two million posts from nearly 2000 Brazilian mayors, we develop, through a supervised machine learning model, an indicator that measures the strength of mayor-congressperson relationships. Our findings show that most connections are relatively weak, though partisanship is positively associated with stronger ties. Our approach offers a low-cost, replicable alternative to traditional methods for studying political intermediation. It advances the understanding of multilevel political dynamics in presidential systems with strong local executives and highlights the role of local elected officials as key, yet often overlooked, brokers in comparative politics.
In territorial politics, whoever controls linkages controls power (Gibson, 2005: 112).
Introduction
There are numerous ways in which local and national arenas get connected in democratic politics. Municipalities may play a central role in implementing policies designed at the national level and/or may depend on transfers from the central government to implement national and locally designed policies. Additionally, towns can be the endpoints of brokerage networks that link local officers to national parties and politicians.
This article focuses on the latter case, examining connections between local and national politicians (Gibson, 2005). More specifically, it presents an original measurement strategy to identify alliances between local executive leaders and national legislators, drawing on the analysis of mayors’ social media posts. We develop an indicator that measures the strength of the relationship between members of parliament (MPs) and mayors, which can be used to identify these allies in different contexts. We expect this indicator to be particularly useful in the Latin American context, where presidentialism is reproduced at the municipal level, making mayors – who concentrate decision-making powers vis-à-vis the legislature – the most prominent leaders in the municipality.
Our indicator is based on the Brazilian case, where alliances between national legislators and mayors are a well-known feature of its political system (Avelino et al., 2012; Bezerra, 1999; Eduardo, 2016; Ventura, 2021). We use more than two million social media posts from Facebook and Instagram – the social networks most commonly used by Brazilian politicians (Braga and Carlomagno, 2018; Braga et al., 2021; Ituassu et al., 2025; Pacheco and Rodrigues, 2025) – covering 36.5 per cent (nearly 2,000) of mayors elected in 2020 to train supervised machine learning models to identify posts in which mayors mention activities commonly associated with these alliances – which correspond to 6–7 per cent of the total. These activities include, among others, publicising meetings between MPs, mayors, and national ministers or state secretaries; ribbon-cutting ceremonies; and videos thanking MPs for allocating budgetary amendments for investments in infrastructure.
We detect and count mentions of MPs in these posts and construct an indicator to assess the strength of these relationships. Despite relying on social media data from only 36.5 per cent of mayors, nearly 90 per cent of MPs are mentioned at least once, suggesting that multilevel alliances are widespread and systemic rather than confined to specific legislators or municipalities.
Our indicator is based on three dimensions: (i) the concentration of posts: Do mayors mention mostly one congressperson or several?; (ii) their longevity: How many days have passed between the first and last mention of this MP?; and (iii) their relevance: How close to the election were they mentioned, how frequently, and how much engagement these posts generated? To avoid potential time-based biases, we restricted our sample of posts to those published after 1 January 2021, when mayors elected in 2020 took office – some, for their second term.
To validate our indicator, we combine analysis of a large amount of quantitative data (election results, geocoded campaign spending, and MPs’ office expenses) with qualitative evidence (mayor interviews and case studies of high-scoring pairs). We introduce a replicable measure to identify and assess the intensity of local–national alliances. Compared to other strategies, our approach is more affordable and offers greater precision than common proxies such as shared partisanship.
We find that most mayor–MP relationships are weak: at least half score below 20 out of 100, with a bimodal distribution and another cluster around 50 points. While partisanship is not necessary for strong alliances, it is positively associated with them. Regression results show that sharing the same party increases the indicator by 13 points (about 0.7 standard deviations), corroborating previous studies (Avelino et al., 2012; Baião et al., 2019; Carneiro and Almeida, 2008; Eduardo and Russo, 2022; Meireles, 2024; Novaes, 2018; Nunes, 2015; Ventura, 2021).
Still, partisanship is an incomplete proxy, and other factors also shape these alliances. Larger municipalities are associated with weaker alliances, though this result is not robust to all specifications. Alliances are also substantially stronger when mayors and MPs come from the same municipality, with an effect size similar to that of partisanship. Findings are also consistent across Facebook and Instagram, which suggests similar use patterns in those social networks. Overall, we show how mayors–MPs alliances are sustained, using a wider set of predictors than previously reported, and introduce a validated social media-based indicator to measure alliance strength comparatively.
Multilevel Alliances in Latin America
Interest intermediation networks involving governmental agencies and politicians at different levels of a political system are a common feature of democratic politics (Valenzuela, 1977; Stokes et al., 2013). Typically, such dynamics emerge because actors at one level control resources desired by those at another. To secure mutual benefits, politicians engage in multilevel alliances that facilitate the flow of financial, informational, reputational, organisational, political, and electoral resources. These dynamics are present both during electoral campaigns and in the periods between elections, shaping governance and policy-making processes.
Local politicians often have closer ties to their communities and a better understanding of local needs and problems (Stokes et al., 2013). On the other hand, they often lack the necessary resources to address these problems. National legislators and party leaders, in turn, control the resources upon which local politicians rely to meet voter demands and sustain their political careers. However, they typically lack the visibility and embeddedness in local communities needed to mobilise electoral support. Through alliances, local and national politicians aim to derive mutual benefits from these resource- and support-based exchanges.
Traditionally, comparative research on territorial and multilevel alliances has primarily focused on formal intergovernmental relations, institutional arrangements, party coordination, and executive leadership, often emphasising electoral periods or coalition formation (Borges et al., 2017; Gibson, 2005; Pálné Kovács, 2021; Schakel and Romanova, 2020; Thorlakson, 2020). However, these studies overlook the informal, everyday practices through which alliances are built and sustained.
We consider multilevel alliances as informal, dynamic, contingent, and cooperative relationships between politicians at different levels of government – similar to the notion of linkages proposed by Gibson (2005). These relationships are grounded in reciprocal dependence on asymmetrically controlled material and immaterial resources. Through these alliances, actors exchange resources (such as financial support, access to public offices, information, votes, organisational capacity, and prestige) that each side controls but the other lacks. These alliances emerge from institutional design and the vertical distribution of resources between central and subnational governments and can be found in federal and decentralised unitary systems.
Scholars have examined these informal practices, particularly in Latin American studies on distributive politics. For example, in his classic study of local politics and brokerage relations in Chile, Valenzuela (1977) analysed the role of mayors as political brokers, mediating local demands with the central government 1 . Indirectly elected mayors would get help from influential congresspeople to secure funds or services for their municipalities. In turn, they would instruct their communities on who to support (Valenzuela, 1977: 131).
These relationships may be structured around partisan alignments (Magaloni, 2006; Stokes et al., 2013) or other criteria such as geographical proximity, personal ties, family networks, or group affiliations (Auerbach, 2018; Dosek, 2023; Holland and Palmer-Rubin, 2015; Hoyler, 2022; Rocha and Gelape, 2024). They are not exclusive to federal systems and, most often, involve members of Congress and mayors. In local politics, mayors typically hold key decision-making powers and control over resources, which makes them the most prominent local political personalities (Leyva-Botero et al., 2021).
A common feature of these relationships is their partisan bias. In Mexico, fiscal and political decentralisation has made governors and, to a lesser extent, mayors, key brokers between the central government and local populations (Diaz-Cayeros et al., 2006). Under such conditions, studies have found partisan bias in federal funds distribution (Calvo and Murillo, 2004; Magaloni et al., 2007; Porto and Sanguinetti, 2001).
Under a less robust party system, alliances between political actors at different levels might have different characteristics. In Peru, the collapse of the party system in the late 1980s transformed alliances into personalistic and temporary arrangements (Meléndez, 2005). Once elected, local politicians operate independently, pursuing access to resources from the national government through informal relationships with congress members.
One common way that congresspeople and local politicians work together is through pork barrel politics. Colombian MPs can benefit their local allies through “cupos indicativos presupuestales” – a form of informal budgetary amendment 2 . Each parliamentarian has an informal individual quota to finance projects and public works in their electoral strongholds, and the cupos indicativos are used to cultivate alliances at the subnational level, given that municipal governments are largely responsible for executing them 3 (Leyva-Botero et al., 2021). Beyond allocating budgetary resources to municipalities, Brazilian legislators can also make their offices available to aligned mayors and constituents, assisting them in navigating state bureaucracy and addressing individual problems (Bezerra, 1999; Inácio, 2011).
Recent scholarship has analysed these relationships by looking at brokers, local operatives who deliver targeted goods and services to voters in exchange for electoral support and political loyalty. Brokerage or mediated political relationships are those involving, on one side, a politician, candidate, or political party, and on the other, an individual voter or group of voters, in which votes or political support are exchanged for benefits and mediated by a third party. Brokers can be party activists, public employees, legislative aides, social, religious, and ethnic leaders, businesspeople, and elected local politicians (Aspinall, 2014; Auyero, 2001; Holland and Palmer-Rubin, 2015; Muñoz, 2014; Novaes, 2018; Stokes et al., 2013). In their relations with national representatives, mayors perform the role of brokers, since they are local operatives who connect national legislators with local voters, channelling political support and votes to the former and material benefits to the latter (Baião et al., 2019; Eduardo, 2016; Gingerich, 2020; Novaes, 2018; Rocha and Gelape, 2024; Valenzuela, 1977).
A subset of the multilevel relationships examined in this article can be understood as political brokerage. MPs control resources valued by voters but cannot effectively convert them into electoral support without credit-claiming. Mayors act as brokers by mediating this process, publicly associating deputies with delivered benefits through inaugurations, social media, and other local events. By repeatedly publicising their allies’ roles over time, mayors help transform resource allocation into electoral support and, during elections, encourage voters to reciprocate in order to ensure the “continuity of good work” (Ames et al., 2008; Bezerra, 1999; Eduardo, 2016; Post and Kuipers, 2023; Rocha and Gelape, 2024; Silotto, 2023). However, most alliances are far more sporadic and not built and sustained through frequent, repeated interactions over time.
The literature on multilevel alliances neither explicitly theorises nor measures the strength of these relationships. Instead, studies within the multilevel governance framework focus on patterns of cooperation and conflict shaped by interests, prerogatives, and control over budgetary resources (Piattoni, 2010). We shift the focus from institutional alignment to political ties, complementing this literature by examining the microfoundations of multilevel alliances. Similarly, scholarship on brokerage and patronage does not directly measure relationship strength. Rather, it centres on the nature of these ties and the principal–agent problems that structure them (Aspinall, 2014; Finan and Schechter, 2012; Holland and Palmer-Rubin, 2015; Stokes et al., 2013; Zarazaga, 2014).
Most of this literature focuses on unelected brokers acting on behalf of parties and politicians in their localities, which has methodological limitations in identifying broker–politician pairs. Depending on who is considered a broker, it may be impossible to compile a comprehensive list from which to draw a representative sample. As such, research in this area often relies on snowball sampling, interviews, and/or ethnographic observation with politicians at different levels to identify their brokers (Dosek, 2023; Eduardo, 2016; Hoyler, 2022; Hoyler and Marques, 2023; Stokes et al., 2013). However, these methods are time and resources consuming, making them difficult to scale. An alternative is to assume that brokers are party affiliates and identify their connections accordingly. Yet this strategy is also flawed, as growing evidence suggests that parties are not the only actors organising brokerage relationships (Holland and Palmer-Rubin, 2015; Muñoz, 2014; Rocha and Gelape, 2024).
Existing techniques for measuring political intermediation and brokerage fall short in identifying pairs of mayor and legislators, as they fail to reveal (i) whether mayors act as brokers by helping legislators claim credit for local benefits; (ii) which mayors serve as brokers for which legislators; and (iii) the extent to which these alliances are structured along party lines.
In this article, we propose an original approach based on mayors’ social media activity to more accurately measure the strength of a mayor–MP relationship. This strategy is grounded in the growing relevance of social media for political communication. We expect that allied mayors will use their platforms to publicise their support and highlight a legislator's activities in the municipality. As such, social media posts represent a potentially valuable data source for detecting these relationships. In the next section, we discuss these alliances in our case study, Brazil.
Multilevel Alliances in Brazil
Alliances between legislators and local politicians in Brazil are a well-documented phenomenon. From the early years after the proclamation of the Republic, during the era of coronelismo (Leal, 2012), to the second half of the twentieth century, there have been reports of politicians operating at different levels of government forming alliances in pursuit of mutual benefits (Diniz, 1982; Gingerich, 2020). In the current context of a competitive democracy with universal suffrage and secret ballots, these dynamics persist, albeit in significantly different forms.
The 1988 Brazilian Constitution recognises three levels of government with political, administrative, and fiscal autonomy. Within this arrangement, municipalities have gained prominence due to their responsibilities in key areas of social policy, such as education and health, and their participation in public spending (Arretche, 1999). Local politicians – particularly mayors – have also become more powerful. Elected directly and endowed with new resources and powers, they can build political and electoral capital independently and leverage it in their relationships with politicians at other levels (Abrucio and Costa, 1998; Almeida and Carneiro, 2003).
Multilevel alliances stem from expectations among politicians and voters and from the country's institutional design, which combines federalism, off-cycle local elections, open list proportional representation, and electoral districts with medium or high magnitudes (Mainwaring, 1991). Furthermore, the concentration of resources at the federal level and the socioeconomic vulnerabilities of many Brazilian municipalities (Bueno, 2018) encourage local politicians and legislators to cooperate, during and between electoral campaigns (Avelino et al., 2012; Baião et al., 2018; Baião et al., 2019; Bezerra, 1999; Eduardo, 2016).
Mayors rely on legislators not only for financial resources through budgetary amendments (Baião et al., 2019; Bezerra, 1999; Eduardo and Russo, 2022; Ventura, 2021), but also for bureaucratic support, information, and access to executive agencies at the state and federal levels. They request assistance with bureaucratic procedures, access to authorities and public agencies, and technical support from MPs’ offices to draft projects, obtain funding from social programs, and resolve problems affecting voters or interest groups (Bezerra, 1999; Rocha and Gelape, 2024).
Multiple studies discuss the importance of local politics in shaping the electoral strategies and activities of legislators. Surveys indicate that legislators place a high value on territorial work, dedicating significant time and energy to servicing geographically concentrated constituencies (Ames et al., 2008; Castro et al., 2009; Eduardo and Russo, 2022; Greggianin, 2014; Inácio, 2011; Melo, 2011; Ricci and Lemos, 2011; Rocha and Gelape, 2024; Zucco, 2009). They emphasise territorial work given their belief that these activities shape voters’ electoral behaviour. Brazilian voters consider local issues when selecting national legislative candidates (Ames et al., 2008), and value mayoral endorsements of legislative candidates (Eduardo, 2016; Eduardo and Russo, 2022), interpreting them as credible signals of electoral viability (Gatto et al., 2021). Nonetheless, these incentives do not affect all MPs equally (Ames, 1994; Power, 2000; Zucco, 2009).
So, in return, legislators rely on mayors to gain visibility in the municipality, build a political reputation, and claim credit for delivering local benefits (Bezerra, 1999; Diniz, 1982; Rocha and Gelape, 2024). In Brazil, a mayor's informational role is even larger given low media coverage in large parts of the country, due to low newspaper circulation, and the uneven presence of local radio and TV stations (Ferraz and Finan, 2008). One indication of a mayor's role in elections is that they boost their party's vote share in the same municipality (Avelino et al., 2012; Baião et al., 2019; Carneiro and Almeida, 2008; Eduardo and Russo, 2022; Meireles, 2024; Nunes, 2015; Novaes, 2018; Ventura, 2021).
Earlier studies on the Brazilian case argued that parties were weak, fragmented, and largely irrelevant in Brazilian local politics (Ames, 1995; Mainwaring, 1993). More recent scholarship, however, has stressed parties’ roles in electoral coordination (Avelino et al., 2012; Carneiro and Almeida, 2008; Fleischer, 2002; Novaes, 2018) and resource distribution (Baião et al., 2018; Baião et al., 2019; Meireles, 2019). Recent evidence also suggests that parties are only one of several – and not the primary – channels through which legislators build alliances with mayors and city councillors (Rocha and Gelape, 2024). Thus, except for a few qualitative small-N studies, large-N studies tend to infer rather than directly observe the relationship between mayors and legislators – often relying on pork barrel patterns or party electoral performance at the municipal level.
In summary, (i) Brazilian legislators need mayors to build reputations in municipalities and claim credit for benefits delivered to the local population; (ii) mayors, especially those in small municipalities, need national legislators to access crucial resources for voter service and their own reelection; (iii) these relationships can be seen as political brokerage; and (iv) party affiliation may matter, but it is not the only or most decisive factor underlying these partnerships.
However, until now, there has been no feasible strategy – cost- or time-wise – for accurately identifying alliances between mayors and legislators at scale. In this article, we present an original indicator that measures the strength of a mayor–legislator relationship based on mayors’ mentions of a representative in contexts that imply these intermediation activities. Focusing on mayors and members of the lower house is appropriate for analysing party affiliation, since parties hold a monopoly on political representation in Brazil (individuals cannot run for office without being affiliated with a party). Therefore, if party affiliation is not the primary factor driving intermediation among actors legally required to be affiliated, it is even less likely decisive in cases involving unelected leaders or informal brokers.
How do Politicians Use Social Media?
For many decades, it has been established that politicians use advertising, credit claiming, and position taking to support their political careers (Mayhew, 1974). The emergence of social media as a medium for communication, interaction, and access to news and information has shaped the behaviour of both representatives and voters, providing new channels for politicians to perform these activities (Manin, 1997).
Several studies have shown that members of Congress use digital platforms to self-advertise, inform voters about their activities, and to interact with their constituencies and supporters (Braga and Carlomagno, 2018; Bessone et al., 2022; Hemphill et al., 2013). Although social media has become a new space for political sociability, its relevance depends on the characteristics of a political system (Braga et al., 2021). It tends to be more important where the institutional arrangement – especially the electoral system – favours personalised relationships between representatives and voters, such as in candidate-centred systems. Its importance as a source of information also increases when parties fail to structure voters’ preferences in a lasting way. This is precisely the Brazilian case 4 .
Besides affecting behaviour, social media also results in new ready-made data that can be used as a source for research (Salganik, 2017). For example, users connections have already been used to estimate ideological position of political actors (Barberá, 2015; Gaughan, 2024; Souza et al., 2017); posts have been validated as potential good proxies to parties’ positions on important topics (Castanho Silva and Proksch, 2022); and to evaluate how leaders influence rank-and-file members to discuss specific issues (Ebanks et al., 2025).
Here, we use mayors’ posts to identify and evaluate mayor's alliances with MPs. A key element in these alliances is a mayor's public endorsement of the MP. There are several ways for her to do so, such as inviting the representative to attend public works inaugurations (Rocha and Gelape, 2024). A less costly method is to make these legislators’ actions visible through a mayor's social media account. Therefore, mayors’ posts become a potentially relevant data source for revealing ties between politicians situated at different levels of the political system. In the next section, we describe how we used Facebook and Instagram posts to develop an indicator to show a mayor-MP's relationship strength.
Methodology
In this section, we describe our measurement strategy, which consists of four main stages. Our main goal is to assess the strength of alliances between mayors and legislators in Brazil. To this end, we collected more than two million social media posts from Brazilian mayors elected in the 2020 local elections. We then ran a series of machine learning models to identify posts in which such alliances were most likely to be expressed. Next, we created an indicator based on (i) how frequently a mayor mentions a given legislator in social media posts, (ii) the duration over which this MP is mentioned across the mayor's posts, and (iii) the relative relevance of these posts among all mayors’ posts over time. Finally, we performed a series of bivariate and multivariate analyses to explore factors associated with this indicator.
Data Collection
Our research is based on public posts on Facebook and Instagram 5 by Brazilian mayors elected in the 2020 municipal elections 6 , published between 2018 and 2022. To identify these mayors’ social media accounts, we relied on self-reported information from all candidates in these elections. Brazilian law requires candidates who wish to publicly ask for votes and advertise on social media to list, in their registration files, all profiles they intend to use during the campaign. Of the 18,794 mayoral candidates, 10,584 (56.3 per cent) reported at least one profile to the Electoral Justice – among those who eventually elected mayors, this proportion was 57.9 per cent.
Because this is self-reported information in an open-ended field, candidates entered their social media profiles in a wide variety of patterns. We extracted only the username information from these records and created lists in CrowdTangle 7 to extract their posts and account-level data. After data collection, we further cleaned the profiles’ information to remove false positives that might have been inadvertently included. Our final sample includes data on 26.7 per cent of all elected mayors on Facebook and 26.6 per cent on Instagram. Because coverage on mayoral social media accounts does not perfectly overlap across platforms, this corresponds to coverage of 36.5 per cent of all elected mayors on at least one social network.
We collected posts published 8 between January 2018 and December 2022 in order to capture three important political moments: the 2018 and 2022 general elections and the 2020 local elections. Our final sample consists of 1.02 million posts on Instagram and 1.13 million on Facebook. As expected, candidates do not use social media in the same way. Compared with other years in the sample, the volume of posts is substantially lower in 2018 and 2019, as shown in Figure 1.

Number of Yearly Posts on Each Social Network.
Most posts are published by a small share of accounts. On Facebook, the ten most active profiles account for 6 per cent of all posts, while on Instagram, the ten most active profiles are responsible for 5 per cent. When considering the 100 most active accounts, they generate 34 per cent of all Facebook posts and 30 per cent of all Instagram posts.
As previously noted, Brazil's 5568 municipalities are highly diverse. A proxy for understanding both social media usage and mayors’ relevance to upper-level politicians is a municipality's electorate size. Figure 2 shows that our sample includes fewer mayors from the smallest municipalities (up to 10,000 voters) than expected under random sampling. These mayors are also less active on social media, as shown by the greater imbalance when post volume is considered. This imbalance is especially pronounced for Facebook. Indeed, as discussed later, we find that mayors from larger cities, as well as younger and more educated mayors, are more likely to be included in our sample.

Proportion of Mayors and Posts in the Sample Compared with Their Population Proportions, by Municipal Electorate Size and Social Network.
A Text-as-Data Approach to Identify Brokerage Activities
Mayors may mention national legislators for several reasons (e.g. to criticise bills introduced in Congress, to discuss pork initiatives sponsored by these congresspeople, or even to amplify messages on salient national topics). Accordingly, references to MPs should not be automatically interpreted as evidence of a potential political allegiance. To avoid these false positives, we employ machine learning algorithms to classify each of our more than two million posts into those that potentially signal such allegiances and those that do not.
To create guidelines to classify posts 9 , we first read a random sample of 2,000 posts containing the words deputado, convênio, or parceiro (member of parliament, agreements, and allies/partners, respectively). A post was coded as a “positive” case – that is, as indicating a potential alliance between a mayor and a national legislator – if it referred to concrete actions, such as meetings they intermediated with other Executive agencies; acknowledgments of budgetary amendments or public works; announcements of campaign-related events. Figure 3 provides illustrative examples.

Politicians’ Posts Showing Intermediation Activities 20
Given that Facebook and Instagram have distinct “grammars” (e.g. Facebook posts usually contain longer texts, while Instagram posts are more image-centred), we treated each platform in a distinct dataset 10 . Accordingly, we created a training set based on two coders 11 who manually classified two new random samples of 2,000 posts from each social network using the criteria described above.
Using these training sets, we ran a pipeline of supervised machine learning algorithms (Grimmer et al., 2022, cap. 19) to replicate our manual classifications and generalise them to the full datasets. The pipeline included six models 12 (Naïve Bayes, Gradient Boosting, Random Forest, XGBoosting, Support Vector Machine (SVC), and Logistic Regression). For the Facebook data, Gradient Boosting achieved the best performance, classifying 79,960 posts (6.9 per cent) as “positive” cases – that is, posts that potentially signal these allegiances. For the Instagram data, Logistic Regression performed best, classifying 60,958 posts (6.0 per cent) as “positive.” These results are reported in Table 1.
Posts Classified as “Positive Cases” (Potential Brokerage Activities).
Source: The authors, from TSE's and CrowdTangle's data.
Once posts were classified, we identified mentions of national legislators in their text. After removing posts from former legislators who became mayors in 2020 13 , we used regular expressions to detect, in a post's text, exact matches to legislators’ “electoral name” (nome de urna), “political name” (the official names listed in the Câmara dos Deputados records), or social media handles (account name). To minimise false positives, we restricted matches to legislators from the same state as the mayor who authored a post. We validated this procedure using a random sample of 1 per cent of posts containing at least one exact match: all these cases were true positives 14 .
Among the mayors included in the sample, 92 per cent mentioned at least one national legislator elected either in 2018 or 2022. Such mentions appear in 30.3 per cent of Facebook posts and 41.1 per cent of Instagram posts. More than 90 per cent of legislators elected in 2018 were mentioned at least once (90.6 per cent on Facebook and 93.6 per cent on Instagram), as were more than 80 per cent of those elected in 2022 (79.9 per cent and 81.5 per cent, respectively).
An Indicator to Assess the Strength of Multilevel Alliances
In this section, we briefly describe 15 a novel indicator we designed to measure the strength of these relationships using social media data. This indicator consists of three dimensions measured at the mayor-legislator level:
• Concentration: the extent to which a mayor's mentions of a specific representative are concentrated relative to all posts in which the mayor mentions national legislators. We argue that the greater the share of mentions an MP receives among a mayor's posts, the stronger their alliance.
• Longevity: the duration over which a mayor expresses a connection with a representative, measured as the number of days between the first and the last post in which the mayor mentions that representative. We theorise that longer periods are equivalent to stronger alliances.
• Posts relevance: the extent to which posts mentioning a specific representative are salient within a mayor's overall social media activity. This dimension combines three elements: (i) temporal proximity to the 2022 elections, since we expect that stronger relationships are more likely to be displayed closer to the elections, when mayors have greater incentives to promote their allies; (ii) the mayor's overall posting frequency, which captures the relative prominence of mentions of national legislators 16 ; (iii) the level of engagement these posts generate – such as likes and comments – weighted by the electorate size of the mayor's municipality. We expect that posts mentioning an MP that are closer to the election and/or come from mayors who post less frequently and/or generate higher levels of voter engagement indicate stronger alliances.
To avoid potential biases from accounts that were active for many years before the elections or that were effectively abandoned after them – we noted that some candidates created these social media profiles solely for campaign purposes –, we restricted our analysis to posts published after 1 January 1 2021, when these mayors took office. In Figure 4, these posts are highlighted in darker colours. This restriction resulted in a sample of 13,277 Facebook posts and 14,951 Instagram posts.

Daily Frequency of Posts Included in and Excluded from the Analysis.
Our sample includes 26.9 per cent (n = 1486) of all Brazilian mayors, considering only those who posted at least once about a national legislator during the period under study. The final value of the indicator is calculated as the average of the normalised values of each dimension, which can be expressed by the following formula:
In this expression, the strength of the relationship between mayor m and national representative d is measured as the average of the normalised values of three dimensions derived from posts in which mayor m mentions representative d: concentration

Distribution of the Relationship Strength Indicator by Social Network.
To validate our indicator, we examine its association with other variables to which it should theoretically be related. More specifically, we analyse its relationship with: (i) the number of votes a legislator received in the mayor's municipality; (ii) the amount of campaign funds the legislator spent in that municipality (Guarnieri and Silva, 2025); (iii) the legislator's office expenditures in that municipality over a legislative term; (iv) a self-reported measure identifying which legislator the mayor considers their main ally 18 ; and (v) a qualitative analysis of the ten pairs with the highest value in the indicator. As shown in Appendix E, all these measures behave as expected: Higher values of our indicator are associated with more votes, greater campaign spending, and higher office expenditures in the mayor's municipality, as well as higher average relationship strength for main allies compared with other legislators.
In addition to these validation exercises, we also examined the correlation between indicator values for identical mayor-legislator pairs observed on both Facebook and Instagram. We find a correlation of 0.87 for the 1916 pairs found on both platforms. Overall, these results indicate that our indicator provides a robust measure of the relationship strength between these political actors.
Assessing the Role of Partisanship, City Size, and Social Network for Mayor–Deputy Relationship Strength
As we have seen in the previous section, most of these relationships are not strong. However, there is both considerable variation in this strength and another set that shows signs of stronger relationships. In this section, we further investigate two factors which should be central to explain these results: partisanship and the mayor city's electorate size.
Figure 6 shows that partisanship is associated with the strength of these relationships in the Brazilian case. The indicator's median value for non-partisan relationships is close to 20, while it reaches a median closer to 40 for partisans. Thus, echoing previous studies, we find that partisanship is an important predictor of these alliances, but is not a necessary condition for them to happen (Rocha and Gelape, 2024).

Mayor-Legislator's Relationship Strength by Party Affiliation.
Another important factor is the city's electorate size. As we have argued, this is an important proxy for how dependent a municipality might be on state and federal transfers, and for how electorally important they are for a national legislator. Overall, 24.6 per cent of mayors mention only one legislator. When considering the electorate size brackets, the number of mayors who mention just one legislator decreases as the number of voters increases. There's an almost linear trend showing that the smaller a city's electorate, the stronger are the relationships between mayors and national legislators, as shown in Figure 7. For towns with up to 10,000 voters, the median relationship strength is close to 27 for both social networks, and for towns with more than 1,000,000 voters, they range between 15 and 20 on Facebook and Instagram, respectively, as seen in Figure 7. Furthermore, the electorate size seems related to the number of legislators a mayor mentions on her posts: on average, mayors from towns with up to 10,000 voters mention 2.5 representatives; those from cities with 20 to 50,000 voters mention 3.62; and those from the largest cities mention 4.5 representatives.

Mayor-Legislator's Relationship Strength by City's Electorate Size.
The results so far appear to support the theoretical expectations regarding these factors. However, because these initial evaluations only consider bivariate associations, Figure 8 presents results from four OLS multiple regression models to further assess these relationships 19 . In addition to partisanship and the city's electorate size, we controlled for localness, the social network, incumbency status, and the mayors’ self-reported age, educational level, gender, and race. The first model (simple) includes city electorate, partisanship, localness (city), social network, and incumbency. The second and third models include all variables, changing only how we measure localness (city or microregion). The last model includes an interaction between partisanship and localness. All models include state-level fixed effects and robust standard errors clustered at the state level.

Factors Influencing Relationship Strength Across Different Specifications.
Localness has been shown as an important predictor of MPs votes in Brazil (Silva and Silotto, 2018), as well as allocation of budgetary amendments (Silotto, 2023). Thus, we created a measure of localness based on the MPs city of birth or a municipality where they won a mayoral or city council election since 2000 (if different from their city of birth). Even if incumbency is not a clear advantage in local elections in Brazil (Klasnja and Titiunik, 2017; Magalhães, 2015), one can argue that incumbents have a larger timeframe to develop relationships with MPs. Thus, we created a three-level variable: not an incumbent; party incumbent, if the mayor is from the same party as his predecessor; incumbent, if they are in their second term.
Results are largely stable across specifications. Ceteris paribus, being from the same party, increases the relationship strength indicator by 0.7 standard deviations (approximately 13 points). This finding suggests that partisan relationships are substantially stronger than non-partisan ones. Furthermore, a 1 per cent increase in the logged value of a city's electorate size corresponds to a 0.16 standard deviation decrease (close to 2 points) in the indicator. This implies that as a city's size increases, the strength of mayor-legislator relationships tends to weaken.
Localness also plays a substantial role. If a mayor and an MP are from the same city, the relationship is nearly 0.7 standard deviations (13 points) stronger than otherwise – an effect remarkably similar in magnitude to partisanship. When localness is measured by shared microregion, the results remain positive but are weaker (0.4 standard deviations). However, contrary to previous research on budgetary amendments (Silotto, 2023), an interaction between localness and partisanship yielded no statistically significant results. Incumbency also appears relevant: second-term mayors maintain stronger relationships with MPs than non-incumbent mayors. Conversely, no statistically significant results were found for mayors from the same party as their predecessors, though the difference between these two types of incumbents is not statistically significant (Gelman and Stern, 2006).
The platform used – Facebook or Instagram – shows no association with the results, aligning with the descriptive patterns observed earlier. Finally, we found no statistically significant association between the relationship strength indicator and other predictors: gender, education (baseline: primary level), or most self-reported race categories (baseline: white). The sole exception is mayors who self-identify as Black, who exhibit weaker relationships with MPs, which merits further research.
External Validity and Robustness Checks
Our measure only captures alliances among the subset of politicians who use social networks. In other words, if the factors that lead a mayor to adopt social media also correlate with their propensity for engaging in these relationships, our previous OLS estimates could be biased. Following the logic of sample selection correction described by Wooldridge (2012), we run a two-step model in which we estimate a selection equation to predict the likelihood of a mayor being included in our sample (Heckman, 1976; Toomet and Henningsen, 2008). In particular, we employ the mayor's age and educational background as our primary instruments for the exclusion restriction. While younger and more highly educated mayors should be significantly more likely to adopt social media, their demographics do not directly influence the structural strength of their brokerage alliances once we control for partisanship or city size. With this setup, we then reestimate our main model – full results can be found in Table F.1 in Appendix F. In the selection model, we find that being younger, more educated, and governing a larger city significantly increases the probability of a mayor being included in the sample. Results from the outcome model support our main results regarding partisanship and localness, as there is a strong effect of both these predictors on our dependent variable. However, it suggests that the previously observed results for city size are due to mayors’ selection into our sample. Moreover, we also do not find consistent results for race, which merits further analysis in future works.
Since our complete dataset contains repeated pairs (appearing in both Facebook and Instagram), we conducted robustness checks using two alternative data configurations. The first excludes all repeated pairs entirely, while the second randomly selects one observation (either from Facebook or Instagram) for each repeated pair. The results, available in Appendix G, are largely consistent with our primary findings – except for incumbents and self-reported black mayors, for whom we do not find a statistically significant association with relationship strength, unlike in our main models.
Finally, to address potential concerns regarding the construction of our indicator, we conducted a robustness check using alternative operationalisations. In the first three specifications, we removed one dimension at a time from the indicator. In the final specification, we excluded the engagement component from the post-relevance dimension. As shown in Appendix H, the substantive results remain consistent with our primary findings, suggesting that the observed patterns are not driven by specific weighting schemes or component choices within the index.
Concluding Remarks
Existing comparative research on territorial and multilevel alliances has primarily focused on formal intergovernmental relations, institutional arrangements, party coordination, and executive leadership, often emphasising electoral periods or coalition formation (Borges et al., 2017; Gibson, 2005; Pálné Kovács, 2021; Schakel and Romanova, 2020; Thorlakson, 2020). While these approaches help explain patterns of cooperation and conflict, they tend to overlook the informal, everyday practices through which alliances are built and sustained.
Shifting the analytical focus from institutional alignment to political alliances, this article expands this literature to incorporate their microdynamics. We used an original strategy to capture informal brokerage processes in which local executives mediate resource flows from national legislators to municipalities while facilitating credit claiming and political support. This moves beyond party- and election-centred accounts, showing how multilevel alliances evolve through recurrent interactions.
From more than two million Facebook and Instagram posts, we trained machine learning models to identify posts most likely to show these alliances. We found that close to 6–7 per cent of all mayor's posts from 2018 to 2022 concern activities central to these alliances, such as mayors announcing federal expenditures, inaugurating public buildings, and electoral campaigning. Even if our initial sample consisted of only 36.5 per cent of Brazilian mayors (elected in 2020), we identified that close to 90 per cent of MPs were mentioned at least once. These results both confirm the importance of these alliances for Brazilian MPs (Bezerra, 1999; Inácio, 2011; Ricci and Lemos, 2011; Rocha and Gelape, 2024) and show that mayors also actively publicise these activities. In doing so, the article underscores the fundamental, yet often overlooked, role of elected local politicians as brokers in multilevel relations, contributing to debates on distributive politics, coordination, and political intermediation across different political contexts.
Then, we created an indicator to measure how strong these connections are, by focusing on three dimensions derived from these posts: their concentration, longevity, and relevance. We observed that most of these relationships are not especially strong, given that more than half of mayor–legislator pairs analysed score under 20 of 100 possible points in our indicator. However, a sizable number of pairs score around 50 points. These mayors are probably those who actively play the role of brokers (Baião et al., 2019; Eduardo, 2016; Novaes, 2018; Nunes, 2015).
Partisanship is not a necessary condition for these strong alliances. But we found a strong and positive association between being from the same party and relationship strength (0.7 standard deviations – 13 to 15 points). Using a novel measure, our findings support previous studies (Avelino et al., 2012; Baião et al., 2019; Carneiro and Almeida, 2008; Ventura, 2021), which show that partisanship plays a relevant role in contexts not characterised by strong party systems or widespread presence of political machines, such as Mexico or Argentina. But, even if partisanship is an important predictor of brokerage, it's also a limited proxy. Future studies should also focus on other motivations for these connections – such as geographic, personal, familial, or group-based ties – to better estimate their effects. For example, we found that localness (Silva and Silotto, 2018; Silotto, 2023) has a similar size to partisanship on relationship strength.
Initially, our results pointed to stronger alliances in smaller towns, which we interpreted as both the municipality's higher dependence on federal resources, and as a sign that there are fewer MPs who win votes in these towns, since they have much lower voters than larger cities. These two factors could lead to stronger alliances. However, once we corrected for potential selection bias using a Heckman two-step model, we did not find significant results for this association. Future research should delve deeper into this aspect to better understand the effort MPs should spend in these alliances, how important smaller towns are for them, and how mayors can get their much-needed resources.
This study also advances our understanding of political communication by showing that mayors use social media not only for visibility and citizen engagement, but also as a tool for political mediation, alliance-building, and credit-claiming within multilevel political systems. A substantial share of mayors’ posts is devoted to these activities, highlighting their relevance even when they do not constitute the most content. Future work should explore how factors such as municipality size, communication professionalisation, digital infrastructure, and strategic priorities shape the intensity and form of these practices.
Methodologically, the article shows how social media data can be used to study informal political practices, such as brokerage and coordination, that are otherwise difficult to observe at scale. It reframes social media not merely as a campaigning or position-taking tool, offering a replicable and relatively low-cost measurement strategy based on ready-made digital data (Salganik, 2017). This approach opens new avenues for comparative research across settings where brokerage is central to politics, including beyond Latin America.
Supplemental Material
sj-docx-1-pla-10.1177_1866802X261445940 - Supplemental material for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data
Supplemental material, sj-docx-1-pla-10.1177_1866802X261445940 for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data by Lucas Gelape, Fernando Meireles, Marta Mendes da Rocha and Guilherme de Abreu Duque in Journal of Politics in Latin America
Supplemental Material
sj-docx-2-pla-10.1177_1866802X261445940 - Supplemental material for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data
Supplemental material, sj-docx-2-pla-10.1177_1866802X261445940 for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data by Lucas Gelape, Fernando Meireles, Marta Mendes da Rocha and Guilherme de Abreu Duque in Journal of Politics in Latin America
Supplemental Material
sj-docx-3-pla-10.1177_1866802X261445940 - Supplemental material for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data
Supplemental material, sj-docx-3-pla-10.1177_1866802X261445940 for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data by Lucas Gelape, Fernando Meireles, Marta Mendes da Rocha and Guilherme de Abreu Duque in Journal of Politics in Latin America
Supplemental Material
sj-docx-4-pla-10.1177_1866802X261445940 - Supplemental material for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data
Supplemental material, sj-docx-4-pla-10.1177_1866802X261445940 for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data by Lucas Gelape, Fernando Meireles, Marta Mendes da Rocha and Guilherme de Abreu Duque in Journal of Politics in Latin America
Supplemental Material
sj-docx-5-pla-10.1177_1866802X261445940 - Supplemental material for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data
Supplemental material, sj-docx-5-pla-10.1177_1866802X261445940 for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data by Lucas Gelape, Fernando Meireles, Marta Mendes da Rocha and Guilherme de Abreu Duque in Journal of Politics in Latin America
Supplemental Material
sj-docx-6-pla-10.1177_1866802X261445940 - Supplemental material for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data
Supplemental material, sj-docx-6-pla-10.1177_1866802X261445940 for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data by Lucas Gelape, Fernando Meireles, Marta Mendes da Rocha and Guilherme de Abreu Duque in Journal of Politics in Latin America
Supplemental Material
sj-docx-7-pla-10.1177_1866802X261445940 - Supplemental material for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data
Supplemental material, sj-docx-7-pla-10.1177_1866802X261445940 for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data by Lucas Gelape, Fernando Meireles, Marta Mendes da Rocha and Guilherme de Abreu Duque in Journal of Politics in Latin America
Supplemental Material
sj-docx-8-pla-10.1177_1866802X261445940 - Supplemental material for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data
Supplemental material, sj-docx-8-pla-10.1177_1866802X261445940 for Multilevel Political Connections and Interest Intermediation: Identifying Political Alliances with Social Media Data by Lucas Gelape, Fernando Meireles, Marta Mendes da Rocha and Guilherme de Abreu Duque in Journal of Politics in Latin America
Footnotes
Acknowledgements
We thank Natália S. Bueno for her essential support to this research, and participants at ANPOCS’ 47th Annual Meeting, FGV-CEPESP's study group, and the “Gobiernos municipales en América Latina” workshop at PUC-Peru (2024) for comments on previous presentations.
Data Availability Statement
Given CrowdTangle's data policies, raw data to replicate these analyses cannot be shared. The code for all analyses is available upon request.
Declaration of Conflicting Interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The authors disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This research was supported by the Fundação de Amparo à Pesquisa do Estado de São Paulo (Grant #2023/04854-6), the Conselho Nacional de Desenvolvimento Científico e Tecnológico (Grant No. 404486/2023-1), and the Coordenação de Aperfeiçoamento de Pessoal de Nível Superior - Programa de Desenvolvimento da Pós-Graduação.
Supplemental Material
Supplemental material for this article is available online.
Notes
Author Biographies
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
