Skip to content

Connect with the codeforces api. Also supports authenticated requests.

License

Notifications You must be signed in to change notification settings

michelececcacci/codeforces_api

Repository files navigation

Codeforces

Unit tests Go Reference codecov

Implements all the methods mentioned in the codeforces api. Creating a client is really simple, all you have to do is:

package main

import (
	"fmt"
	"os"

	"github.com/michelececcacci/codeforces"
)

func main() {
	key := os.Getenv("CF_API_KEY")
	secret := os.Getenv("CF_API_SECRET")
	c := codeforces.NewClient(key, secret)
	resp, err := c.User.Friends(false)
	if err != nil {
		fmt.Println(err)
	} else {
		fmt.Println(resp)
	}
}

You can also leave the key and secret parameters empty, but you wont be able to access methods that require authentication such as c.Client.Friends(). For examples refer to the examples folder

About

Connect with the codeforces api. Also supports authenticated requests.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages