Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hemanta212/nepal-election-api
A rest json api for nepal election 2079 written in GO
https://github.com/hemanta212/nepal-election-api
2079 api election go nepal
Last synced: about 1 month ago
JSON representation
A rest json api for nepal election 2079 written in GO
- Host: GitHub
- URL: https://github.com/hemanta212/nepal-election-api
- Owner: hemanta212
- Created: 2022-11-20T15:35:23.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-22T13:09:45.000Z (about 2 years ago)
- Last Synced: 2024-10-12T15:48:48.292Z (2 months ago)
- Topics: 2079, api, election, go, nepal
- Language: Go
- Homepage: https://electionapi.osac.org.np
- Size: 16.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nepal Election API 2079
Developed using the fantastic [gocolly](https://github.com/gocolly/colly) scraping library, data source is [ekantipur](https://election.ekantipur.com)
This repo was developed as backend for election-bot for reddit hosted at https://github.com/pykancha/reddit-bots
Hosted at https://electionapi.osac.org.np
## Installation
- Install go
- Clone the repo
```
git clone https://github.com/hemanta212/nepal-election-api
cd nepal-election-api
```
- Install dependencies
```
go mod tidy
```
- Run the server
```
go run .
```
- For building an executable, use;
```
go build .
./nepal-election-api
```## Usage
###### AreaNameRequests at
```
/area?name=pradesh-1/district-jhapa
```where name is valid kantipur url part representing an electoral area.
This is supposed to be extracted from a kantipur url.Example: https://electionapi.osac.org.np/area?name=pradesh-1/district-jhapa
###### URL
Requests at
```
/url?url=https://election.ekantipur.com/pradesh-1/district-jhapa?lng=eng
```where url must be valid kantipur url in format similar to url in above example.
Example: https://electionapi.osac.org.np/url?url=https://election.ekantipur.com/pradesh-1/district-jhapa?lng=eng
###### Bulk List
Requests at```
/bulk?list=pradesh-1/district-jhapa,pradesh-3/district-kathmandu
```Where list must be list of valid AreaNames sepearated by commas.
Example: https://electionapi.osac.org.np/bulk?list=pradesh-1/district-jhapa,pradesh-3/district-kathmandu
###### Summary
Requests at
```
/summary
```Gives all party names, their wins and leads count in Federal and provincial category.
Example: https://electionapi.osac.org.np/summary