[HN Gopher] Show HN: Dog API
       ___________________________________________________________________
        
       Show HN: Dog API
        
       Hello there, happy holidays.  I've been maintaining for 6 years
       this Dog API that only returned facts. I recently rewrote the
       project to make it more flexible [1] and I had a blast doing so.
       This API has been used by a lot of computer science students, as
       well as bots and other 3rd party services that integrated in the
       past. The old endpoint receives around 1,000-1,500 requests per
       day, which makes me happy.  The goal is to extend it to make it
       more interesting and usable, I collect dog data in my spare time.
       I'm not looking to monetize it, it's just for the love of
       education.  Feel free to use it, and share it!  [1]:
       https://github.com/kinduff/dogapi.dog
        
       Author : kinduff
       Score  : 206 points
       Date   : 2022-12-27 10:23 UTC (12 hours ago)
        
 (HTM) web link (dogapi.dog)
 (TXT) w3m dump (dogapi.dog)
        
       | pcardoso wrote:
       | Thanks! As soon as I find the time I will use it in my useless
       | project, https://caolendario.pt, a pun on the Portuguese word cao
       | (dog) + calendario (calendar).
       | 
       | Photos are taken from https://dog.ceo/dog-api/, a similar
       | project.
        
         | culi wrote:
         | More FE-relevant, but also relevant: https://placekitten.com/
        
       | thangngoc89 wrote:
       | Kind of off-topic: I built a single HTML file website to fetch
       | dogs images from Flickr tears ago for my girlfriend. Totally
       | forgot about it until now. It seems to be still functioning.
       | 
       | https://gimmeadog.khoanguyen.me/
        
         | barbarbar wrote:
         | I suppose the style sheet for the site could be named dog-
         | style.css?
         | 
         | Wait - maybe not a good name after all.
        
       | scrollaway wrote:
       | Okay, when you said "dog api", I thought you hooked up a RPC API
       | to a voice assistant that says "sit", "come", "take" etc and
       | trained your dog to respond to it.
        
         | layer8 wrote:
         | I was expecting it to be dog slow.
        
         | AlbertCory wrote:
         | Expectations. I was expecting an API for dogs _to use_. Bark
         | once for a treat, put paw on human for some affection, scratch
         | at the door to go out, etc.
        
         | kshay wrote:
         | 402 Treats Required
        
         | bombcar wrote:
         | This is what I was hoping for - and of course there would be a
         | cat option but it would simply return "not implemented" for
         | everything.
        
       | genezeta wrote:
       | The swagger doc for version 2 points to localhost and so the "Try
       | it out" buttons fail.
       | 
       | I mention this only because it's not very clear to me if you'll
       | be providing an endpoint for v2 or this is no longer the case and
       | people are expected to install their own server, as the README on
       | the repository suggests.
       | 
       | Other than that, thanks. It looks like a nice tool to have for
       | teaching :)
        
         | kinduff wrote:
         | Thank you for pointing that out, I've updated the Swagger file
         | to make it work as expected.
        
           | genezeta wrote:
           | Ah, ok. Great :)
        
       | BeFlatXIII wrote:
       | This reminds me of the Capybara API.
       | 
       | https://github.com/Looskie/capybara-api
       | 
       | (The other one seems to give a CDN error these days)
        
         | kinduff wrote:
         | Really like the documentation, will try something similar,
         | additionally to the Swagger UI.
        
       | [deleted]
        
       | canadapups wrote:
       | I did the same thing but dumped it into a table. Small enough
       | dataset that can load the entire thing and just use jquery to
       | filter via drop down selector.
       | 
       | To make it useful I tried filter on characteristics that a buyer
       | would be interested in such as long-haired vs. short.
       | 
       | I also gathered the data manually. I'll have to compare datasets
       | 
       | https://www.canadapups.com/breeds
        
       | endofreach wrote:
       | Nice. I love silly things like this.
       | 
       | An example on the homepage would be nice. Maybe something about
       | Laika (https://en.wikipedia.org/wiki/Laika)
        
         | julianlam wrote:
         | Unrelated to OP, but is it SOP for Russian agencies to
         | deliberately obfuscate or outright lie on otherwise
         | uncontroversial data?
         | 
         | > Laika died within hours from overheating, possibly caused by
         | a failure of the central R-7 sustainer to separate from the
         | payload. The true cause and time of her death were not made
         | public until 2002; instead, it was widely reported that she
         | died when her oxygen ran out on day six or, as the Soviet
         | government initially claimed, she was euthanised prior to
         | oxygen depletion.
         | 
         | There seems to be little reason to lie about this given Laika's
         | survival was already nil.
        
           | jen20 wrote:
           | > is it SOP for Russian agencies to deliberately obfuscate or
           | outright lie
           | 
           | Yes.
        
           | burkaman wrote:
           | Having the first living thing in orbit survive for a week vs.
           | a few hours makes a pretty big impact on the perception of
           | your new space program. "Total success, now we just have to
           | figure out re-entry" vs. "failure, our spacecraft cannot
           | sustain life yet".
        
           | kennywinker wrote:
           | Laika was launched into orbit in 1957. At that time "Russia"
           | was a member of the USSR (soviet union) called the "Russian
           | Soviet Federative Socialist Republic" (https://en.wikipedia.o
           | rg/wiki/Russian_Soviet_Federative_Soci...). That government
           | collapsed in 1991, and was replaced by the current "Russian
           | Federation" government.
           | 
           | Which is relevant history to your question, because SOP for
           | the USSR/RSFSR is very different from SOP for the current
           | government. The current gov is corrupt and lies, but has
           | entirely different motivations than the government that lied
           | for 34 years about Laika.
        
           | wodenokoto wrote:
           | Of course they are gonna say things worked out as planned.
        
       | mkoryak wrote:
       | http://TheCatApi.com gives me cat pictures.
       | 
       | Can this dog API do that? If so, that would be a huge "selling"
       | point
        
         | kinduff wrote:
         | I'm gathering some images for breeds, already have everything
         | in place to upload them. This feature will come soon.
        
         | bentobean wrote:
         | I love the fact that Cat API offers an _Enterprise_ plan.
        
           | mkoryak wrote:
           | That's because cat pictures are the 2nd most viewed type of
           | picture on the interwebs.
        
       | greenpeas wrote:
       | Is anyone surprised that there's a .dog top level domain? When
       | did they add all these extra domains? Also where's the .god TLD?
        
         | lioeters wrote:
         | > On June 20, 2011, ICANN's board voted to end most
         | restrictions on the creation of generic top-level domain names
         | (gTLDs) -- at which time 22 gTLDs were available. Companies and
         | organizations would be able to choose essentially arbitrary
         | top-level Internet domains.
         | 
         | > The initial price to apply for a new gTLD was $185,000. ICANN
         | expected the new rules to significantly change the face of the
         | internet. Industry analysts predicted 500-1000 new gTLDs,
         | mostly reflecting names of companies and products, but also
         | cities, and generic names like bank and sport.
         | 
         | > ..Esther Dyson, the founding chairwoman of ICANN, wrote that
         | the expansion "will create jobs [for lawyers, marketers and
         | others] but little extra value."
         | 
         | https://en.wikipedia.org/wiki/Generic_top-level_domain#New_t...
        
       | xcambar wrote:
       | Excellent. This goes straight into my list of nice APIs for
       | student work and coding exercises. If there's any way to
       | contribute or support, you should advertise it.
        
         | culi wrote:
         | You might also like:
         | 
         | https://randomuser.me/api/
        
         | ryanSrich wrote:
         | It would be awesome to see that list you have!
        
         | kinduff wrote:
         | Thank you! Feel free to contribute to the main repository [1],
         | using "buy me a coffee" in the FAQ, or GH Sponsors program [2]
         | to support the server.
         | 
         | [1]: https://github.com/kinduff/dogapi.dog#contributing
         | 
         | [2]: https://github.com/sponsors/kinduff
        
       | cube00 wrote:
       | I'm learning more about Restful API design and was wondering why
       | there is a generic "data" wrapper, "type: bread/group/facts" and
       | generic "attributes" structure rather then just returning a
       | object designed for the specific type of data being described.
        
         | kinduff wrote:
         | Take a look at the JSON:API specification https://jsonapi.org
        
       | rideontime wrote:
       | Personally lost interest as soon as I saw the awful AI "art" at
       | the linked page. Not expecting everyone else to have the same
       | opinion, but mine is mine.
        
         | chickenpotpie wrote:
         | "Before you speak ask yourself if what you are going to say is
         | true, is kind, is necessary, is helpful. If the answer is no,
         | maybe what you are about to say should be left unsaid."
        
         | [deleted]
        
       | zensayyy wrote:
       | I always use your API to place images when I need to show
       | something! Thanks haha
        
       | ReactiveJelly wrote:
       | How big is the overall dataset?
        
       | counttheforks wrote:
       | > I lost ownership of the Slack application due to Slack's
       | policy. I tried to regain ownership of my own application but it
       | was not possible.
       | 
       | Would love to hear more about this.
        
       | mkraft wrote:
       | I think you should open source the data, too, by uploading a SQL
       | dump to Github. It provides more learning vectors.
        
         | kinduff wrote:
         | Will give it a thought, thanks for your comment.
        
           | jarofgreen wrote:
           | One possible advantage here depends on how you do this, but
           | you could make it easy for others to add/edit dog facts and
           | thus help you maintain the data (with moderation, if wanted).
           | Is this something you are interested in? This can be
           | complimentary to the API - it doesn't have to replace it.
           | 
           | (I'm writing on an open source tool to help people do this
           | with files in Git repos.
           | https://pypi.org/project/DataTig/#data )
        
             | donalhunt wrote:
             | sounds like hooking the API up to wikidata would be a
             | sustainable long-term solution (presumes wikidata has the
             | relevant coverage).
        
       | andai wrote:
       | Cool project. Noob question here, the homepage mentions that V2
       | follows some kind of standard, and the API docs page mentions
       | "JSON API schema", does that refer to this?
       | https://jsonapi.org/format/
        
         | kinduff wrote:
         | That is correct, it is referring to that standard.
        
           | ramses0 wrote:
           | The glory of "ERROR" documents as a concept!
           | 
           | JSONAPI is too complicated at first, then exactly as
           | complicated as is useful over time.
        
       | xigoi wrote:
       | Why does this need to be an API? Why not just provide a file with
       | the relevant information?
        
         | kinduff wrote:
         | I wanted to build this as an API. What are the advantages -
         | learning wise - of using a file with the relevant information?
        
           | [deleted]
        
           | Tepix wrote:
           | You could bulk import it into your own database and run
           | arbitrary queries locally.
           | 
           | Of course if you want to use this as a learning project for
           | writing and using APIs... that takes precedence ;-)
        
           | rouxz wrote:
           | Learning wise there is no advantage, but for it to be
           | actually useful for people that's a better option imo.
        
           | andai wrote:
           | The implementation of dogdump (a Dog API to SQLite scraper)
           | left as an exercise to the reader ;)
        
       | nothrowaways wrote:
       | Excellent API.
        
       | thih9 wrote:
       | Is the API aiming to be a high quality source of dog related
       | facts? Or is the focus mostly on exposing an API for testing code
       | and the content is not a priority?
       | 
       | Also: is the data open source? Can we contribute to that too,
       | e.g. send a PR?
        
         | kinduff wrote:
         | I've tried to curate the information as good as possible, but
         | some facts are hard to confirm. Same for breed descriptions and
         | other data.
         | 
         | The main goal is to expose a fun API, and then be as accurate
         | as possible. I'm working on the latter.
        
           | [deleted]
        
       | harshaw wrote:
       | From a fun / teaching / learning point of view - I get it. As
       | others are saying however, the secondary learning that you want
       | is that sometimes a database is the right solution.
       | 
       | For example, a student could learn that they need to use a API
       | (with all of the API problems: latency, server down, throttling,
       | blah blah blah) when all they really need to do is download a
       | sqlite file, hook up sqlite to their application, run one query -
       | and have a vastly simpler application. This could be as little as
       | 10-50 lines of code. Never underestimate the power of shipping
       | data via sqlite files.
        
         | strogonoff wrote:
         | Considering a set of relatively infrequently changing facts
         | about external world, publishing them as RDF can be a good
         | choice. Developers can use it in whatever way they need,
         | including loading it into SQLite--and it's self-documenting, so
         | they don't need some extra information such as a spec to
         | explain what everything means. It can link to external data for
         | things beyond its scope that someone else already took care of.
         | Other data can link to it, too--so it benefits open information
         | exchange.
         | 
         | (Yes, RDF has got a bit of a bad rap in some circles, but I
         | don't think it's entirely justified... More importantly, RDF is
         | incredibly boring, so publishing such a dataset is likely to
         | gather much less attention than releasing a free public API, at
         | least here.)
        
         | medellin wrote:
         | For this use case that works well but a big part of that
         | learning is the data is fairly static and likely doesn't update
         | often
        
         | alexchamberlain wrote:
         | Files/dumps as an API is vastly underrated.
        
         | [deleted]
        
       | pfoof wrote:
       | Will make a Datadog check for it in python to pull data and
       | display the results on a dashboard. Maybe also some alerting, if
       | breeds count suddenly drops or something
        
       ___________________________________________________________________
       (page generated 2022-12-27 23:00 UTC)