TSE Portal has repository with information on all elections held since 1950

Researchers, journalists, voters and citizens can search data from elections held in the country since 1950 at the web Portal of the Superior Electoral Court (TSE).

Researchers, journalists, voters and citizens can search data from elections held in the country since 1950 at the web Portal of the Superior Electoral Court (TSE). Those interested in obtaining information on the topic can access the Election Data Repository, an important tool where users can search for election results, candidates, the electorate profile and even accountability reports.
The repository exists since 2009, even before the Access to Information Law (Law 12,527/2011) entered into force in May 2012. Since the demand for information is increasing, the Court decided to make the data available on the Internet to allow for faster response to data requests from any interested party.
Data on the electorate profile, for example, is available for all elections since 1994. The files contain demographic information (such as gender and age group) for voters from all districts of the country. The data is detailed down to the Electoral Areas: one can learn, for example, that in 1994 the municipality of Acrelândia (state of Acre) had 2,473 voters.
Information about candidates and election results can be consulted back to 1950, while accountability information is available as of the 2002 elections. Besides indicating the political party and whether or not the person was elected, the ‘candidates’ section provides data on gender, profession, education, marital status and nationality of election candidates.
Querying
The easiest way to query the Repository is to download the files and rename them, changing the extension from ".txt" to ".csv”. That way, the file can be opened in any spreadsheet application. The TSE provides only the raw data, with any query, filtering or cross-referencing of such data being the responsibility of the researcher.
All queries generate two files, one with the data and another with instructions for formatting the tables. It is important to read the instruction file, since it contains the layout of the tables in the electoral data repository, and also to note the date of generation of the file in order to make imports and queries appropriately.
The data is updated periodically to reflect all recounts made. Information concerning the 2012 municipal elections, for example, is updated daily. Some files may be blank or display error messages, usually due to temporary unavailability on a state-level repository or to that file not being available at the time.