Skip to content

thehowl/go-osuapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Apr 27, 2024
d8fb25d · Apr 27, 2024

History

52 Commits
Oct 17, 2016
May 1, 2016
May 1, 2016
Sep 24, 2017
Oct 17, 2016
Oct 4, 2017
Mar 12, 2017
May 1, 2016
May 1, 2016
Apr 27, 2024
May 1, 2016
May 1, 2016
May 1, 2016
Dec 19, 2018
May 1, 2016
May 1, 2016
Apr 27, 2024
May 1, 2016
May 1, 2016
May 1, 2016
May 1, 2016
May 1, 2016
Sep 24, 2017
May 8, 2016

Repository files navigation

go-osuapi docs Build Status Go Report Card

go-osuapi is a Go package to retrieve data from the osu! API.

Getting started

Everything is (more or less) well-documented at godoc - the methods that interest you most are probably those under Client. Also, client_test.go contains loads of examples on how you can use the package. If you still want to have an example to simply copypaste and then get straight to coding, well, there you go!

package main

import (
	"fmt"
	osuapi "github.com/thehowl/go-osuapi"
)

func main() {
	c := osuapi.NewClient("Your API key https://osu.ppy.sh/p/api")
	beatmaps, err := c.GetBeatmaps(osuapi.GetBeatmapsOpts{
		BeatmapSetID: 332532,
	})
	if err != nil {
		fmt.Printf("An error occurred: %v\n", err)
		return
	}
	for _, beatmap := range beatmaps {
		fmt.Printf("%s - %s [%s] https://osu.ppy.sh/b/%d\n", beatmap.Artist, beatmap.Title, beatmap.DiffName, beatmap.BeatmapID)
	}
}

Please note that if you actually want to use this, you should consider vendoring this using the dep tool, so that your code keeps working regardless of any change we might do in this repository.

I want more than that to explore how it works!

I've made whosu for that purpose. Check it out.

Contributing

Contributions are welcome! Here's what you need to know:

  • Always go fmt your code.
  • If you're writing a big and useful feature, make sure to appropriately write tests!