IndiaVotes APIindiavotes.com ↗
Access Lok Sabha and Vidhan Sabha election results, constituency details, candidate search, and party summaries via the IndiaVotes API. Data from 1952 to 2024.
What is the IndiaVotes API?
The IndiaVotes API exposes 7 endpoints covering Indian parliamentary and state assembly election data from 1952 through 2024. Use get_lok_sabha_results to pull national party summaries or drill into constituency-level winner names, vote shares, and margins. Companion endpoints handle candidate search, historical Vidhan Sabha results by state, and ranked candidate breakdowns for individual constituencies.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/cb783535-dd58-4206-8ecf-4783e2766dce/get_pc_elections' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace indiavotes-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
from parse_apis.indiavotes_election_api import IndiaVotes, ElectionCategory
client = IndiaVotes()
# List all Lok Sabha elections
for election in client.elections.list():
print(election.year, election.url)
# Get states for the 2024 election
election_2024 = client.election(year="2024")
for state in election_2024.states():
print(state.slug, state.name)
# Get party-wise national results for 2024
for party in election_2024.party_results(category=ElectionCategory.PC):
print(party.party, party.seats_won, party.vote_share)
# Get constituency results for Maharashtra
result = election_2024.results(state_slug="maharashtra")
for constituency in result.constituencies:
print(constituency.constituency, constituency.winner, constituency.vote_share)
# Drill into a specific constituency's candidate details
detail = result.constituencies[0].details(year="2024", state_slug="maharashtra")
for cand in detail.candidates:
print(cand.rank, cand.candidate, cand.party, cand.votes, cand.share)
# Get assembly elections for a state
maharashtra = client.state(slug="maharashtra")
for ac_election in maharashtra.assembly_elections():
print(ac_election.year, ac_election.url)
# Search for candidates by name
for candidate in client.candidates.search(name="Modi"):
print(candidate.name, candidate.party, candidate.constituency, candidate.is_current)
List all Lok Sabha (Parliamentary) general elections from 1952 to 2024. Returns year and URL path for each election. Use the year value as input to other Lok Sabha endpoints.
No input parameters required.
{
"type": "object",
"fields": {
"items": "array of election objects with year and url"
},
"sample": {
"data": {
"items": [
{
"url": "/lok-sabha/2024/",
"year": "2024"
},
{
"url": "/lok-sabha/2019/",
"year": "2019"
},
{
"url": "/lok-sabha/2014/",
"year": "2014"
}
]
},
"status": "success"
}
}About the IndiaVotes API
Lok Sabha Coverage
get_pc_elections returns every Lok Sabha general election year from 1952 to 2024, each with a URL path you pass to downstream endpoints. get_pc_states takes a year parameter and lists the states and union territories that participated, returning a slug and name per state. Feed that slug into get_lok_sabha_results to get constituency-level results — winner name, party, vote share, and margin — or omit it to receive a national party_summary array alongside the full states list.
Vidhan Sabha Coverage
get_ac_elections accepts a state_slug and returns every assembly election year on record for that state. Constituency-level candidate breakdowns — rank, votes, and vote share — are available through get_constituency_details using the category parameter set to 'ac', plus the state_slug and constituency_slug values obtained from earlier calls. The same endpoint handles Lok Sabha constituencies when category is 'pc', and surfaces past_elections data when by-elections occurred.
Party and Candidate Queries
get_all_party_results returns seats won, seats contested, vote share, and total votes at the national level for Lok Sabha (omit state_slug), or party performance within a single state assembly election when category is 'ac' and state_slug is provided. search_candidates runs a fuzzy name match across all current and historical Lok Sabha MPs, returning name, state, party, constituency, url, is_rajya_sabha, and is_current per result — useful for building candidate profile lookups or name-disambiguation workflows.
The IndiaVotes API is a managed, monitored endpoint for indiavotes.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when indiavotes.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official indiavotes.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a historical seat-swing tracker by comparing
party_summaryfields across multiple Lok Sabha election years. - Generate per-constituency winner cards using winner name, party, vote share, and margin from
get_lok_sabha_resultswith a state_slug. - Identify all candidates who contested a specific constituency using the ranked
candidatesarray fromget_constituency_details. - Search for a politician by name via
search_candidatesand surface their party, state, and current-MP status. - Map Vidhan Sabha election timelines per state using the
yearvalues returned byget_ac_elections. - Produce party-performance tables for a state assembly election using seats won, contested, and vote share from
get_all_party_results. - Detect constituencies where by-elections occurred by checking for the
past_electionsfield inget_constituency_detailsresponses.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does IndiaVotes have an official developer API?+
What does `get_lok_sabha_results` return differently with and without a state_slug?+
state_slug, the endpoint returns a national party_summary array (seats, vote share, total votes per party) and a states list. When you supply a state_slug, it returns a constituencies array with individual constituency winners, party affiliations, vote share, and margin. You cannot get both views in a single call.Does `search_candidates` cover Rajya Sabha members and candidates from state assembly elections?+
is_rajya_sabha flag and an is_current flag. The documentation notes coverage spans Lok Sabha MPs; Rajya Sabha and Vidhan Sabha candidate search is not explicitly included in the index. You can fork this API on Parse and revise it to add a dedicated assembly-candidate search endpoint.Can I get voter turnout figures or demographic breakdowns for constituencies?+
Are election results available for union territories as well as states?+
get_pc_states returns both states and union territories that participated in a given Lok Sabha election year, so union territories with Lok Sabha constituencies are included. Coverage depends on whether the territory had representation in the specific election year queried.