Forum Settings
Forums
New
Apr 19, 2012 5:39 AM
#1

Offline
Jan 2010
10
I suppose this is connected to special characters and stuff but I've run across some problems when searching for a title using the API. Particularly, I'm having trouble retrieving information for 'Rockman.EXE Beast+' which, when searched for, returns a 'NoContent' status. I had a similar problem with Black Rock Shooter (TV) but found that simply searching for 'BRS (TV)' solved it. With 'Rockman.EXE Beast+' though, I have no idea what I should search for instead.

My guess is that this is a problem with the '+' character so I'd like to know: what should I search for in such a case?
Apr 19, 2012 5:47 AM
#2
Lead Admin
Faerie Queen

Offline
Aug 2007
6262
I added the synonym "Rockman EXE Beast Plus", so you can search with that for now.

Not too sure how the other users using the api deal with special characters. Hopefully someone with more knowledge about that can help you out.
Apr 19, 2012 5:58 AM
#3

Offline
Jan 2010
10
Thank you for the quick response.

I usually parse for special characters before turning the stream into an actual XML so, although it's troublesome, it's been ok so far. The problem is indeed with titles like these that have apparently no way to be searched for with the API and I'm afraid there are more titles in such a situation =(

Anyways, thanks again for the quick fix =)
Apr 20, 2012 6:28 PM
#4

Offline
May 2008
4052
Because certain characters like + are special entities in URIs and HTTP, they need to be url-encoded into % values. The hex for + is 2b so it becomes %2B and your request would start with something like:

GET /api/anime/search.xml?q=Rockman.EXE+Beast%2B HTTP/1.1

Most languages have some sort of function built in to convert ("url-encode") to this format. This should also work with unicode, though there have been occasions where malformed unicode characters in the DB entries themselves won't match the correct unicode in the query. Please let us know in the database subforum here if you encounter issues like that.
sakaApr 21, 2012 11:14 AM

I am a banana.
Apr 21, 2012 8:32 PM
#5

Offline
Jan 2010
10
Perfect! There is indeed such a function. Thanks!

It's weird though, the character for space also needs to be encoded as %20 but I never had to worry about it... I guess '+' is just super special (concatenation etc.).
Apr 22, 2012 10:53 PM
#6

Offline
May 2008
4052
Whitespace should never exist in a url, but generally it is fixed automatically for you by the library you use to send the request. Spaces can be properly represented by %20 or simply + in the query part of the URI.

I am a banana.
Oct 13, 2012 3:30 PM
#7

Offline
Aug 2008
1
The search method only returns 20 results, how can I get all of them?


Compare:

http://myanimelist.net/api/anime/search.xml?q=dragon

vs

http://myanimelist.net/anime.php?q=dragon
Feel the music in your heart ~

More topics from this board

Sticky: » Inactive Username Request Thread ( 1 2 3 4 5 ... Last Page )

Kineta - Sep 21, 2015

3369 by Confused-_- »»
2 hours ago

» ishinashi has 300 alt accounts and counting ( 1 2 3 )

deg - Jun 16, 2023

127 by Spunkert »»
5 hours ago

» Backup

Vapor_AU - Yesterday

1 by pichipichiHiro »»
Yesterday, 8:23 PM

» MAL Export

Devileeee - Sep 25, 2023

3 by zororo12 »»
Apr 23, 3:52 AM

» Problem with API OAuth2 Authentication Login

bidgetfoss_4000 - Apr 23

0 by bidgetfoss_4000 »»
Apr 23, 3:44 AM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login