Gleam functions for interacting with the spacetraders.io game API
Find a file
Lily Rose 80a4f6ee89
Some checks failed
test / test (push) Failing after 2s
Update readme
2025-12-13 23:03:22 +11:00
.github/workflows Initial commit 2025-07-09 02:07:44 +10:00
src Refactor to use new model version 2025-12-13 22:10:54 +11:00
test Initial commit 2025-07-09 02:07:44 +10:00
.gitignore Initial commit 2025-07-09 02:07:44 +10:00
gleam.toml Refactor to use new model version 2025-12-13 22:10:54 +11:00
LICENSE.md Initial commit 2025-07-09 02:07:44 +10:00
manifest.toml Refactor to use new model version 2025-12-13 22:10:54 +11:00
README.md Update readme 2025-12-13 23:03:22 +11:00
spacetraders.openapi.json Initial commit 2025-07-09 02:07:44 +10:00

spacetraders_api

Package Version Hex Docs

For specific http client implementations see spacetraders_api_httpc and spacetraders_api_fetch

gleam add spacetraders_api@2
import spacetraders_api
import spacetraders_models
import gleam/httpc

pub fn main() -> Nil {
  let assert Ok(agent_token) = spacetraders_models.parse_agent_token("...")
  case spacetraders_api.get_account_request(agent_token) |> httpc.send_bits {
    Ok(res) -> {
      echo spacetraders_api.get_account_response(res)
      todo
    }
    Error(err) -> todo
  }
}

Further documentation can be found at https://hexdocs.pm/spacetraders_api.

Development

gleam run   # Run the project
gleam test  # Run the tests