×
  • remind me tomorrow
  • remind me next week
  • never remind me
Subscribe to the ANN Newsletter • Wake up every Sunday to a curated list of ANN's most interesting posts of the week. read more

Forum - View topic
ANN API new developer questions :)




Anime News Network Forum Index -> Site-related -> Bugs & Technical Questions
View previous topic :: View next topic  
Author Message
FFGenerations



Joined: 16 Nov 2014
Posts: 3
PostPosted: Sun Nov 16, 2014 8:58 pm Reply with quote
Hey guys, I'm a university student doing a software engineering final project. I'm interested in making a website application that permits user to search an anime database (such as ANN or MAL) and retrieve anime cover images (and anime info) as a response.

I'm a newbie to programming so I've been struggling a bit to get started FYI.

Right now I'm looking into what anime databases/APIs are available to public use and just having a look at ANN in order to compare it with MAL and AniDB.

Would anyone be able to please comment on your API for me or perhaps direct me to documentation page? I'm interested to know things like...

1) what programming language can I use or is recommended to use with your API? For instance, AniDB has a UDP API (although I don't know what that means yet!) and MAL Atarashii formats into JSON instead of XML but only supports PHP

2) what are the limitations or advantages of your API or ANN as a web service? for instance, a) are there any limitations to your API or functionality I might miss? b) I will have to be careful not to send to many requests to your website or I will get banned - how can i find out more about this?

3) How is your anime database maintained - is it a collaborative effort by staff moderating user input? How does your site compare to say MAL database? (I know this is a weird question but its interesting to know for my project and being able to justify decisions Very Happy )

4) What existing apps use ANN API? (obviously I'll have a search round the site and google regarding this and my other questions Smile )

5) Would you recommend that I develop using ANN API?

I guess that is enough questions for now Very Happy

I have other questions as a newbie developer with regards to things like ... choice of programming language ... choice of framework ... choice of database ... how to increase performance (speed) of my website using things like Ajax requests, and how this might have an impact on my use of your API/resources?

Thanks ever so much for reading. Send me a PM if you want or an angry message telling me that I should be reading X documentation etc Very Happy (will go have a search around now)

Really any help or tips at all would be awesome.

Cheers

Edit: just reading your FAQ/About page animenewsnetwork.com/faq#what_is_ann


Edit2:

Your API documentation page animenewsnetwork.com/encyclopedia/api.php is really small when compared to the AniDB documentation page(s) http://wiki.anidb.net/w/UDP_API_Definition

I'm wondering if somebody with any technical understanding might be able to briefly explain the major difference between the two?
Back to top
View user's profile Send private message
Tempest
I Run this place.
ANN Publisher


Joined: 29 Dec 2001
Posts: 10419
Location: Do not message me for support.
PostPosted: Wed Nov 19, 2014 5:03 pm Reply with quote
I've pointed this question out to Dan.

-t
Back to top
View user's profile Send private message Send e-mail My Anime My Manga
FFGenerations



Joined: 16 Nov 2014
Posts: 3
PostPosted: Sat Nov 22, 2014 8:58 am Reply with quote
Tempest wrote:
I've pointed this question out to Dan.

-t


Thanks dude.
Answers to some questions become clearer as I progress slowly with the project research..

However I think I will definitely need to know if you impose any guidelines or regulations on the use of your API. It may be that since you're a large website that you don't have any traffic problems with people using your API and hence don't have any guidelines.

I've sort of narrowed down choosing between you and Hummingbird - Hummingbird because the programmer staff are real friendly and ANN because your API looks really simple and straight-forward with good documentation and on a large reliable website.

If someone could reply with a comment like "sure go ahead, ANN will be fine to work with" that'd be great Wink (or the opposite)

Today I'll be doing some project research/work, maybe get in contact with other developers, go back and read your documentation and check to see if I would need to be whitelisted etc, see if there is a risk of being accidentally banned and if getting unbanned is a fast process, and see if I can finalise my choice of API/website.

Cheers!
Back to top
View user's profile Send private message
Dan42
Chief Encyclopedist


Joined: 02 Jan 2002
Posts: 3780
Location: Montreal
PostPosted: Mon Nov 24, 2014 9:41 pm Reply with quote
1) The API just returns just XML data. If your programming language can process XML (i.e. all of them) that means you can use it.

2a) One limitation I can think of is that the API is read-only. You can't use it to submit data on behalf of users.

2b) We've never had to impose limits because we've never had problems. If someone uses the API in a way that causes the website performance issues then we'll add rate-limiting or something. As long as you don't use the API in a massively parallel fashion (ex. sending 10k requests simultaneously) I doubt there will be any problem.

3) It's a collaborative database. I have no idea about the MAL database so I can't make comparisons there.

4) I'm not keeping track of that

5) uh... yes? Smile

FFGenerations wrote:
Your API documentation page is really small when compared to ...
I don't believe in excessive wordy documentation. No one's going read it anyway. The documentation has everything you need to get started. After that the output of the API will tell you all you need to know about what data is returned.

FFGenerations wrote:
If someone could reply with a comment that'd be great Wink
sure go ahead, ANN will be fine to work with
Back to top
View user's profile Send private message Visit poster's website AIM Address My Anime My Manga
FFGenerations



Joined: 16 Nov 2014
Posts: 3
PostPosted: Thu Feb 19, 2015 11:20 pm Reply with quote
Hi again, thanks for your responses last time. I'm back on this project after some downtime Anime hyper

I sent you a PM with this, Dan, but my sentbox appears empty so I thought I'd better post here just incase:


I have a question about using your encyclopedia API.

I want my website homepage to display to users the top 10 rated anime on your website along with their thumbnail images.

I could have my website fetch/update a list of these on a daily/weekly basis and store the thumbnails myself.

Is there a report I can use to retrieve this data? I am looking at animenewsnetwork.com/encyclopedia/reports.php?id=172&nskip=0&nlist=10 however this doesn't return the thumbnail url of the anime.

I guess a good alternative option would be to send a 2nd request to gather the full details of each anime after fetching the anime IDs from the first report.. but I thought I should ask if its possible to get (anime title) + rating + thumbnail in one report Smile (that's all the data i would need i believe)

Also, what is "gid" here? animenewsnetwork.com/encyclopedia/reports.php?id=155

Thankyou! Smile
Back to top
View user's profile Send private message
Dan42
Chief Encyclopedist


Joined: 02 Jan 2002
Posts: 3780
Location: Montreal
PostPosted: Sun Feb 22, 2015 11:35 am Reply with quote
Yes, if you want the thumbnail info, make a second request to get the anime details. That's what it's for.

The gid is the same value that you get in the <anime> tag
Encyclopedia API wrote:
<anime id="1234" gid="2415734675" type="TV" name="Calimero" precision="TV 1/1972" generated-on="2015-02-22T16:33:05Z">

There's an anime#1234, a person#1234, a company#1234, but gid 2415734675 refers to one thing only, it's a global id.
Back to top
View user's profile Send private message Visit poster's website AIM Address My Anime My Manga
bocahapi



Joined: 27 Mar 2015
Posts: 1
PostPosted: Fri Mar 27, 2015 11:59 am Reply with quote
hi, im try use API in PHP languange but i have error. can any want tell me about how to use API in PHP please Sad
Back to top
View user's profile Send private message
Tempest
I Run this place.
ANN Publisher


Joined: 29 Dec 2001
Posts: 10419
Location: Do not message me for support.
PostPosted: Wed Apr 15, 2015 9:09 am Reply with quote
bocahapi wrote:
hi, im try use API in PHP languange but i have error. can any want tell me about how to use API in PHP please Sad


You'll have to describe your error in a bit more detail.
Back to top
View user's profile Send private message Send e-mail My Anime My Manga
_INTER_



Joined: 25 Apr 2015
Posts: 1
PostPosted: Sat Apr 25, 2015 10:15 am Reply with quote
Sorry for shooting in between, but we might encounter the same error. I'm also using the API to extract some information with Python.
However for certain XML responses a "xml parsing mal formed error" occurs. Same with firefox. For example:
cdn.animenewsnetwork.com/encyclopedia/api.xml?title=16816
there seems to be an invisible backspace control character before the first japanese character in the tag (which appears at least for the "official website" tag with gid=342673510)
Back to top
View user's profile Send private message
gudvinr



Joined: 03 Feb 2015
Posts: 5
PostPosted: Thu Apr 30, 2015 6:56 am Reply with quote
_INTER_ wrote:
Sorry for shooting in between, but we might encounter the same error. I'm also using the API to extract some information with Python.
However for certain XML responses a "xml parsing mal formed error" occurs. Same with firefox. For example:
cdn.animenewsnetwork.com/encyclopedia/api.xml?title=16816
there seems to be an invisible backspace control character before the first japanese character in the tag (which appears at least for the "official website" tag with gid=342673510)


curl gives me pretty normal result - http://pastebin.com/PxtkSxKB
But as you can see, backspace char removes '>' after info tag on 10th string.
I guess that you can solve your problem inside your parser. For example, it's possible to replace all U+0008 chars with empty string.
Back to top
View user's profile Send private message
Dan42
Chief Encyclopedist


Joined: 02 Jan 2002
Posts: 3780
Location: Montreal
PostPosted: Thu Apr 30, 2015 12:02 pm Reply with quote
Ok I fixed the bad data in the Encyclopedia, but it'll take a little while for the cached page to renew.

It looks like it was the only entry that contained a 0x08 character, but honestly I'm flabbergasted that
1) someone managed to type a backspace character in the input field
2) it was not escaped by the regular htmlspecialchars function
Back to top
View user's profile Send private message Visit poster's website AIM Address My Anime My Manga
pushrbx



Joined: 30 Apr 2015
Posts: 4
Location: United Kingdom
PostPosted: Thu Apr 30, 2015 12:11 pm Reply with quote
_INTER_ wrote:
Sorry for shooting in between, but we might encounter the same error. I'm also using the API to extract some information with Python.
However for certain XML responses a "xml parsing mal formed error" occurs. Same with firefox. For example:
cdn.animenewsnetwork.com/encyclopedia/api.xml?title=16816
there seems to be an invisible backspace control character before the first japanese character in the tag (which appears at least for the "official website" tag with gid=342673510)


Just use lxml and get a parser with the recover flag set to true.
example:
https://pastebin.com/RergEsg3
Back to top
View user's profile Send private message Visit poster's website
Shiroi Hane
Encyclopedia Editor


Joined: 25 Oct 2003
Posts: 7578
Location: Wales
PostPosted: Thu Apr 30, 2015 12:55 pm Reply with quote
Something I noticed looking at this (unrelated to the thread sorry) - the source given for the Japanese title was a page on the admin server. It is being displayed as the public (www.) server in the non-edit view, but with a double slash after the domain.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number My Anime My Manga
Display posts from previous:   
Reply to topic    Anime News Network Forum Index -> Site-related -> Bugs & Technical Questions All times are GMT - 5 Hours
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group