https://github.com/togatoga/goforces
goforces is go package for the codeforces api
https://github.com/togatoga/goforces
api-client codeforces codeforces-api competitive-programming go golang golang-library
Last synced: 26 days ago
JSON representation
goforces is go package for the codeforces api
- Host: GitHub
- URL: https://github.com/togatoga/goforces
- Owner: togatoga
- License: mit
- Created: 2017-09-21T13:32:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-08-04T08:17:07.000Z (over 5 years ago)
- Last Synced: 2025-10-11T09:09:53.541Z (4 months ago)
- Topics: api-client, codeforces, codeforces-api, competitive-programming, go, golang, golang-library
- Language: Go
- Homepage:
- Size: 56.6 KB
- Stars: 13
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# goforces
[](https://travis-ci.org/togatoga/goforces) [](https://godoc.org/github.com/togatoga/goforces)[](https://goreportcard.com/report/github.com/togatoga/goforces)
goforces is go package for the codeforces() api.
Check the [Usage](#usage)
## Install
```
go get github.com/togatoga/goforces
```
## Usage
```go
package main
import (
"context"
"fmt"
"github.com/togatoga/goforces"
)
func main() {
ctx := context.Background()
//logger
logger := log.New(os.Stderr, "*** ", log.LstdFlags)
//Codeforces client
api, _ := goforces.NewClient(logger)
//Problems
problems, _ := api.GetProblemSetProblems(ctx, &goforces.ProblemSetProblemsOptions{Tags: []string{"dp"}})
fmt.Printf("%+v\n", problems)
//Contest list
contestList, _ := api.GetContestList(ctx, nil)
fmt.Printf("%+v\n", contestList)
//If you use authorized methods, you must set your key and secret
api.SetAPIKey("")
api.SetAPISecret("")
//User friends
friends, _ := api.GetUserFriends(ctx, nil)
fmt.Printf("%+v\n", friends)
}
```
The official codeforces api documentation is [here](http://codeforces.com/api/help)
## Documention
Read [Godoc](https://godoc.org/github.com/togatoga/goforces)
## License
[MIT License](LICENSE)