This is a project (in PHP) which takes in TMDB IDs and season numbers, and returns the MyAnimeList ID.
It uses the TMDb API to get the season air date, and then searches on MyAnimeList (using Jikan.moe) to get the MAL ID.
I needed it, because I was getting data from TMDb, but needed MyAnimeList to display the sources.
You can use the already hosted version: https://tmdb2mal.slidemovies.org/?id={tmdb_id}&s={season_number}
Made possible using Jikan.moe (www.jikan.moe) & The TMDb API (api.themoviedb.org)
Under the MIT license