Skip to content

Pre Requirements

hrothwell edited this page Feb 21, 2023 · 2 revisions

MyAnimeList API key/app setup

This application requires that the user create and register their own API key with MAL. As this is a CLI tool, I did not want to risk publicizing my own API key.

Creating an API key

  1. Navigate to MAL's API config page
  2. Select "Create ID"
  3. Fill out the form similarly to below

image

  • the most important part is to specify the app redirect URL as http://localhost:8080/mal, as this is the redirect url the CLI sends to MAL and it must match for certain requests to be valid

Create mal-secret.json

After you create this application, you are given a client id. Place this client id and your username in $HOME/mal-cli/mal-secret.json. An example file:

{
  "user_name": "<Your user name>",
  "client_id": "<Your client id>"
}

After this, you can start using the CLI. Some commands will not work unless you run mal login, after following the login process your mal-secret.json should end up looking similarly to:

{
  "user_name": "<Your user name>",
  "client_id": "<Your client id>",
  "oauth_authorization_code": "<really long string used in authorization process>",
  "oauth_tokens":{
    "token_type": "Bearer",
    "expires_in": 2678400,
    "access_token": "<really long string used to make oauth calls>",
    "refresh_token": "<really long string used to refresh access_token when it expires>"
  }
}

After adding your username and client id manually, you should not edit this file. All edits should be handled by the CLI ideally. If things simply will not work, the file can be deleted, recreated with user_name and client_id, and the login command/process done again

Clone this wiki locally