https://github.com/ju0x/palworldapi
Easy to use wrapper for the Palworld REST API
https://github.com/ju0x/palworldapi
api go golang palworld palworld-dedicated-server palworld-server rest server
Last synced: about 2 months ago
JSON representation
Easy to use wrapper for the Palworld REST API
- Host: GitHub
- URL: https://github.com/ju0x/palworldapi
- Owner: Ju0x
- License: apache-2.0
- Created: 2024-10-13T12:20:19.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-10-14T14:52:33.000Z (8 months ago)
- Last Synced: 2025-02-23T19:37:38.848Z (3 months ago)
- Topics: api, go, golang, palworld, palworld-dedicated-server, palworld-server, rest, server
- Language: Go
- Homepage:
- Size: 25.4 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Palworld API Wrapper

[](https://app.codacy.com/gh/Ju0x/palworldapi/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[](https://goreportcard.com/report/github.com/Ju0x/palworldapi)
Easy to use wrapper for the Palworld REST API
[Set up a Palworld Server](https://tech.palworldgame.com/)
[Read the API Docs](https://tech.palworldgame.com/category/rest-api)
## Installation
You can install the package by using `go get` in your Go Project.
```
go get -u github.com/Ju0x/palworldapi
```
This will pull the latest release.## Usage
First you need to initialize a new PalworldAPI instance with credentials.
```go
pal := palworldapi.New("http://localhost:8212", "admin", "admin password")
```Typically the username is `admin`.
The `AdminPassword` is set in the Server Configuration. ([How to configure the Palworld Server](https://tech.palworldgame.com/settings-and-operation/configuration))
The REST API must be activated on the server with the `RESTAPIEnabled=True` option.
### First Hello World
With the palworldapi instance you are now able to use the wrapper functions.
```go
package mainimport "github.com/Ju0x/palworldapi"
func main() {
pal := palworldapi.New("http://localhost:8212", os.Getenv("USERNAME"), os.Getenv("ADMIN_PASSWORD"))// Sends the message to the server globally
pal.Announce("Hello World!")
}
```Then run it
```
USERNAME=admin ADMIN_PASSWORD=your_admin_password go run .
```The result should look like this:
## Examples
You can find some examples [here](https://github.com/Ju0x/palworldapi/tree/main/examples)