Many governments have introduced pay for performance (P4P) programmes to incentivise health providers to improve quality of care. Evidence is limited on whether P4P reduces or exacerbates disparities in healthcare. We examined socioeconomic inequalities in the performance of family health teams under Brazil’s National Programme for Improving Primary Care Access and Quality (PMAQ). We analysed longitudinal data on the quality of care delivered by family health teams participating in PMAQ over three rounds of implementation: round 1 (Nov 2011 – Mar 2013), round 2 (Apr 2013 – Sep 2015) and round 3 (Oct 2015 – Dec 2019). The primary outcome was the proportion of the maximum performance score obtained by family health teams (the PMAQ score), based on several hundred indicators of healthcare delivery. Using census data on local area household income, we examined the PMAQ score by income ventile. We provide the analysis code and the codebook that underpinned the study. Some of the data used in the study - which capture the performance of family health teams over three rounds of PMAQ implementation - are owned by the Ministry of Health in Brazil and we do not have permission to share the data publicly.