fork of github.com/yitsushi/go-misskey
Find a file
Iris Lightshard e4e9476efd
Some checks failed
Code Check / Test and coverage (push) Has been cancelled
Code Check / go vet and lint (push) Has been cancelled
Code Check / golangci lint check (push) Has been cancelled
release / release (push) Has been cancelled
rename module
2025-10-22 18:34:57 -06:00
.github update linter 2024-10-30 14:07:42 +01:00
core rename module 2025-10-22 18:34:57 -06:00
docs fix: Add omitempty to multipartField (#102) 2023-10-05 13:38:55 +02:00
models rename module 2025-10-22 18:34:57 -06:00
services rename module 2025-10-22 18:34:57 -06:00
test rename module 2025-10-22 18:34:57 -06:00
.golangci.yml update linter 2024-10-30 14:07:42 +01:00
client.go rename module 2025-10-22 18:34:57 -06:00
client_test.go rename module 2025-10-22 18:34:57 -06:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md (#40) 2020-10-25 03:27:52 +01:00
CONTRIBUTING.md refactor: deprecate NewClient in favor of NewClientWithOptions (#90) 2022-03-21 22:16:22 +01:00
go.mod rename module 2025-10-22 18:34:57 -06:00
go.sum Bump golang.org/x/net from 0.33.0 to 0.36.0 (#116) 2025-03-13 10:20:25 +01:00
LICENSE Initial commit with readme and license 2020-10-08 11:47:58 +02:00
Makefile Update Makefile 2020-10-27 12:47:57 +01:00
options.go rename module 2025-10-22 18:34:57 -06:00
README.md docs: Fix example codes (#105) 2023-10-16 11:43:24 +02:00
services.go rename module 2025-10-22 18:34:57 -06:00

Go Report Card Coverage Status GoDoc Chat on Matrix

Misskey Go SDK

Misskey API Documentation: https://slippy.xyz/api-doc

Check the docs directory for more information.

For examples on given endpoints, please check the corresponding _test.go file, they have at least one ExampleService_XYZ function, examples:

Progress

Status Endpoint Group Implementation Issue Note
antennas #3
app #5
clips #8
drive #9
federation #4
following #10
groups #19
hashtags #12
meta
notes #6
notifications #15
reactions #14
⚠️ admin #21 In Progress (84%)
account
auth
channels
charts #7
list #20
messaging #13
pages #16
users #17

How to use

For detailed examples, check the example directory.

package main

import (
	"log"
	"os"

	"github.com/sirupsen/logrus"
	"github.com/yitsushi/go-misskey"
	"github.com/yitsushi/go-misskey/core"
	"github.com/yitsushi/go-misskey/services/meta"
)

func main() {
	client, err := misskey.NewClientWithOptions(
		misskey.WithAPIToken(os.Getenv("MISSKEY_TOKEN")),
		misskey.WithBaseURL("https", "slippy.xyz", ""),
		misskey.WithLogLevel(logrus.DebugLevel),
	)
	if err != nil {
		logrus.Error(err.Error())
	}

	stats, err := client.Meta().Stats()
	if err != nil {
		log.Printf("[Meta] Error happened: %s", err)
		return
	}

	log.Printf("[Stats] Instances:          %d", stats.Instances)
	log.Printf("[Stats] NotesCount:         %d", stats.NotesCount)
	log.Printf("[Stats] UsersCount:         %d", stats.UsersCount)
	log.Printf("[Stats] OriginalNotesCount: %d", stats.OriginalNotesCount)
	log.Printf("[Stats] OriginalUsersCount: %d", stats.OriginalUsersCount)
}

How can I get a Misskey Token?

Navigate to Settings > API and there you generate a new token.

How can I debug what's wrong?

There is a logging system, right now it's not very wide spread in the codebase, but if you turn it on, you will be able to see:

  • all request with method, endpoint and body
  • all responds with status code, from what endpoint told and the body

To enable debug mode, just change the LogLevel to DebugLevel:

client, _ := misskey.NewClientWithOptions(
	misskey.WithAPIToken(os.Getenv("MISSKEY_TOKEN")),
	misskey.WithBaseURL("https", "slippy.xyz", ""),
	misskey.WithLogLevel(logrus.DebugLevel),
)

The output should look like this:

DEBU[0000] POST https://slippy.xyz/api/antennas/show     _type=request
DEBU[0000] {"antennaId":"8dbpybhulw","i":"my misskey token"}  _type=request
DEBU[0000] {"id":"8dbpybhulw","createdAt":"2020-10-13T16:03:22.674Z","name":"Genshin Impact","keywords":[["genshin"]],"excludeKeywords":[[""]],"src":"all","userListId":null,"userGroupId":null,"users":[""],"caseSensitive":false,"notify":false,"withReplies":true,"withFile":false,"hasUnreadNote":false}  _type=response code=200 from="https://slippy.xyz/api/antennas/show"