Forum Settings
Forums
New
Apr 6, 2022 4:41 AM
#1
Offline
Apr 2020
22
Hello,

i am playing a bit with the API because i am planning to write a python wrapper.
During this process i noted that there are some things missing from the documentation (https://myanimelist.net/apiconfig/references/api/v2)

The ones i noted so far are:

    - 'web_novel' and 'mixed_media' are not listed as possible values for the source field for an anime but are returned by the api
    - 'on_hiatus' and 'discontinued' are not listed as a possible manga status
    - nsfw query parameter not specified for each endpoint, i found that it can be used when searching and when requesting a user list

If somebody has noted something else maybe we can gather all the information in this post, i will update it over time.

EDITS:

    - 'light_novel' is not listed as a possible value for media_type field in the manga details enpoing
    - nsfw parameter also works for seasonal anime
    - nsfw values returned are only 'white' or 'gray', i haven't been able to find one reported as 'black'
    - minimum query length for searches is 3 characters and maximum is 64
    - anime endpoint accepts 'opening_themes' and 'ending_themes' as filed and return an array of objects structured like
    {
        id: int  -> id of the song
        anime_id: int -> id of the corresponding anime
        text: str  -> description, usually in the format "title by author (episode range)"
    }
    

    - in anime details, the statistcs numbers are returned as strings but the documentation states that they should be int
        "statistics": {
            "status": {
                "watching": "176831",           # a json parser parses these as strings due to having ""
                "completed": "2937125",
                "on_hold": "45120",
                "dropped": "52247",
                "plan_to_watch": "152876"
            },
            "num_list_users": 3364199     # this is parsed correctly
        }
    

    - for the /forum/topics endpoint:

      + at least one of the paramters is required to get a result
      + topic_user_name and user_name usage is not clear

    - the /forum/topic endpoint for the details:

      + doesn't return a list of topics but only the specified topic
      + poll key can be missing from the result if there is no poll
      + poll attribute is "closed" not "close" as reported in the schema (although in the json example it is correctly reported as "closed")
      + i could not find a post with more than one poll but the documentation states that poll can is an array. However if there is only one poll it is not returned in an array.

    - the /anime/season endpoint doesn't report only the anime that started in that season, but all the ones that were airing during that season even if they started before or they are still ongoing to this day. This contradicts the name of the filed since it is called "start_season".
    - the "offset" parameters is not always deterministic. For example in anime and manga searches doing the same query with different offsets sometimes returns returns different results

    # fetching this url different times returns different results, these are the ones i found
    # (some fileds are excluded for clarity)
    'https://api.myanimelist.net/v2/manga?q=kanojo&offset=2&limit=2'
    
    result1
    {
        "node": {
            "id": 68521,
            "title": "Kin no Kanojo Gin no Kanojo"
        }
         "node": {
             "id": 96334,
             "title": "Kanojo to Kanojo no Neko"
           }
    }
    
    result 2
    {
         "node": {
             "id": 96334,
             "title": "Kanojo to Kanojo no Neko"
           }
        "node": {
             "id": 88537,
             "title": "T-Rex na Kanojo"
           }
    }
    


    - related_manga field seems to be always empty for anime and viceversa (see this thread)
    - sorting by anime_id or manga_id in when requesting the list yields a error 400 but they are in the documentation as valid parameters
    - there is a typo in the fields returned by the endpoint /forum/topic: returns "forum_avator" instead of "forum_avatar"
    - requesting alternative_fields on some mangas cause an error (see this thread)
    - 'num_favorites' is not reported as a valid field for anime and manga endpoint
    - sorting by score does not work when requesting seasonal anime (see this thread)
    - 'spin_off' 'other' and 'character' are not reported as possible relation_types for related anime and manga
    - 'genres' can be missing from an anime/manga details payload even if requested
    - 'studios' can be an empty list
    - 'videos' is a possible field for anime, see this thread
    - related and recommended titles can be retrived with additional fields in a single call by including them in braces, for example
    request at https://api.myanimelist.net/v2/manga/91941?fields=recommendations{num_favorites}
    
    response (only relavant part)
    "recommendations": [
            {
                "node": {
                    "id": 100128,
                    "title": "Yakusoku no Neverland",
                    "main_picture": {
                        "medium": "https://api-cdn.myanimelist.net/images/manga/3/186922.jpg",
                        "large": "https://api-cdn.myanimelist.net/images/manga/3/186922l.jpg"
                    },
                    "num_favorites": 18908
                },
                "num_recommendations": 4
            },
            { .....
        ]
    

    basically all fields can be returned this way, except recursively asking for recommended or related titles. This only works on the anime and manga details endpoint, it is not supported in searches, ranking etc



Thanks to @KatsuteDev @DiamondTMZ @Uchuuu Destructor_Mundial Gruzin WORMSS for providing some of this information
Skylake_Apr 17, 6:32 AM
Python API wrapper (v0.10.1 is out)
https://github.com/Skylake-dev/mal.py
for problems/suggestion you can open an issue or start a new discussion
Reply Disabled for Non-Club Members
Apr 8, 2022 10:00 AM
#2

Offline
Aug 2019
22
Can you share the anime/manga IDs where this happened? I might need them to test changes to my Java API.
Apr 10, 2022 12:53 PM
#3
Offline
Apr 2020
22
hello, sorry for late reply, these are some IDs i found:

- Berserk, id=2, manga status is on_hiatus
- anime ids 34474, 35999, 32596 have mixed_media as source while 37208 is web_novel
- about nsfw parameter i tried requesting some seasons of anime and the results didn't change with or without the parameter, do you know other endpoints where it can be used?
Python API wrapper (v0.10.1 is out)
https://github.com/Skylake-dev/mal.py
for problems/suggestion you can open an issue or start a new discussion
Apr 11, 2022 6:57 PM
#4

Offline
Aug 2019
22
Thanks for sharing the IDs.

The NSFW parameter does work for season queries; I used Winter 2014 to test it, test case linked below:

https://github.com/KatsuteDev/Mal4J/blob/f0a76e72fc6bd97cbc09ddd24d3d3893bada95e4/src/test/java/com/kttdevelopment/mal4j/AnimeTests/TestAnimeSeason.java#L71

This season has ~6 results that classify as NSFW.
Apr 12, 2022 4:49 AM
#5
Offline
Apr 2020
22
Thank you, but for me that season has 20 titles marked as nsfw (all 'gray')
here are the ids if you want to check
[21597,
22039,
20849,
22069,
21751,
38817,
20589,
21363,
21059,
21393,
22429,
18095,
23479,
21521,
21829,
20545,
15565,
31424,
22081,
21513]
Python API wrapper (v0.10.1 is out)
https://github.com/Skylake-dev/mal.py
for problems/suggestion you can open an issue or start a new discussion
Apr 12, 2022 6:03 AM
#6

Offline
Aug 2019
22
Guess I miscounted, at least the NSFW param works for you now.
Apr 14, 2022 11:16 AM
#7
Offline
Nov 2018
58
Search query character length is not documented as far as I'm aware, I know that minimum length is 3 characters but maximum length I am not sure of.
Also the opening_themes and ending_themes fields aren't documented
Apr 14, 2022 11:43 AM
#8
Offline
Apr 2020
22
thank you, i knew about the minimum lenght but i forgot to put it in the list.
I didn't know about the opening and ending themes though, i will add them now
Python API wrapper (v0.10.1 is out)
https://github.com/Skylake-dev/mal.py
for problems/suggestion you can open an issue or start a new discussion
Apr 15, 2022 6:08 AM
#9
Offline
Nov 2018
58
The maximum character length for a search query seems to be 64 characters.
Credits to @Uchuuu for experimenting and finding out on the unofficial discord server
Apr 15, 2022 6:09 AM

Offline
Aug 2018
148
DiamondTMZ said:
The maximum character length for a search query seems to be 64 characters.
Credits to @Uchuuu for experimenting and finding out on the unofficial discord server


No worries. I'm gonna plug the Discord here too: https://discord.gg/fr7GWvSBxC

Anyway these are interesting bugs. A couple of them have already been reported but it's unlikely they will be fixed anytime soon. MAL is not dedicating many resources to the API.
Apr 15, 2022 8:11 AM
Offline
Apr 2020
22
thank you, i updated the list
Python API wrapper (v0.10.1 is out)
https://github.com/Skylake-dev/mal.py
for problems/suggestion you can open an issue or start a new discussion
Reply Disabled for Non-Club Members

More topics from this board

» [discontinued] I made a webapp to compare plan-to-watch lists

daux - Apr 16, 2022

33 by daux »»
Oct 2, 4:17 PM

» Requesting additional authorizations

SomeNewGuy - Aug 18

1 by ZeroCrystal »»
Aug 22, 8:31 AM

» Scraping from HTML suggested rate

Davenzo - Jan 8, 2023

4 by 7k72 »»
Jun 23, 6:35 AM

» Accessing Many Users' List

loukylor - Jun 11

0 by loukylor »»
Jun 11, 3:07 PM

» Caching strategy to avoid making additional API calls

Jakuten - Jun 3

4 by Jakuten »»
Jun 8, 11:30 AM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login