Forum Settings
Apr 19, 2012 5:39 AM

Joined: Jan 2010
Posts: 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
DB Administrator
Faerie Queen

Joined: Aug 2007
Posts: 4699
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.

  Open Staff Apps
  Guidelines & FAQ
  Report Abuse
  Listen ♪

Credits: 1
Apr 19, 2012 5:58 AM

Joined: Jan 2010
Posts: 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

Joined: May 2008
Posts: 4070
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.
Modified by saka, Apr 21, 2012 11:14 AM
Apr 21, 2012 8:32 PM

Joined: Jan 2010
Posts: 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

Joined: May 2008
Posts: 4070
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.
Oct 13, 2012 3:30 PM

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


Feel the music in your heart ~