Re:Show HN: Dog API
by kinduff on Tuesday December 27, 2022 @05:28AM
(#34147401)
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.
Re:Show HN: Dog API
by genezeta on Tuesday December 27, 2022 @07:44AM
(#34148141)
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 :)
Re:Show HN: Dog API
by andai on Tuesday December 27, 2022 @09:42AM
(#34149060)
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/
Re:Show HN: Dog API
by thih9 on Tuesday December 27, 2022 @07:23AM
(#34148045)
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?
Re:Show HN: Dog API
by xcambar on Tuesday December 27, 2022 @07:55AM
(#34148202)
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.
Re:Show HN: Dog API
by jarofgreen on Tuesday December 27, 2022 @01:58PM
(#34152314)
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.
Re:Show HN: Dog API
by scrollaway on Tuesday December 27, 2022 @08:29AM
(#34148396)
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.
Re:Show HN: Dog API
by julianlam on Tuesday December 27, 2022 @10:10AM
(#34149317)
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.
Re:Show HN: Dog API
by burkaman on Tuesday December 27, 2022 @02:47PM
(#34152895)
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".
Re:Show HN: Dog API
by kennywinker on Tuesday December 27, 2022 @03:36PM
(#34153452)
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.org/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.
Re:Show HN: Dog API
by harshaw on Tuesday December 27, 2022 @08:51AM
(#34148593)
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.
Re:Show HN: Dog API
by strogonoff on Tuesday December 27, 2022 @10:52AM
(#34149670)
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.)
Re:Show HN: Dog API
by Ao7bei3s on Wednesday December 28, 2022 @01:24AM
(#34158065)
I agree, but also don't underestimate the problems and risks in real systems that keep changing.
I've shipped some data in a JSON file bundled with an application, because it didn't change a lot, and we had frequent (biweekly) releases anyway. I mistakenly assumed those two things would always be true.
As time went on, the frequency of necessary changes increased but our overall products release cadence got worse and worse (many months) as the product grew. So customers had continually outdated data.
An additional problem I didn't expect is that since we wanted to get customers the latest data (because the next release was so far out), we had to update the data set as close to release as possible. So always a change at the last minute, which is already a busy time and means it's not really tested well. And also it was extra toil; we had a script for data generation but it still needed a manual run and pull request. In the time I spent running this I could have easily written an API based version several times.
Another problem was that this change had to be made for every release, including bugfix ones. This caused frequent discussion (do we need this?), was forgotten a few times, and caused merge conflicts later which were annoying because in this case the proper way to merge was to ignore both ancestors and rerun the script, which people weren't used to.
Of course I rewrote it eventually (after convincing PM that I need time for this supposedly long done feature again), but then I had to deal with the extra problem of customers who had local customer specific modifications of the file (because that was the workaround our support staff came up with as a way to deal with the outdatedness).
Thankfully, a problem I did not habe was binary data in git. The commits were ugly but at least still got ok diffs (once we sorted the JSON file properly). But you mentioned SQLite, which is not a good match for git. Of course one can work around it by merging the raw SQL, but still, yet another pitfall.
Re:Show HN: Dog API
by pcardoso on Tuesday December 27, 2022 @09:23AM
(#34148867)
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 cão (dog) + calendário (calendar).
Re:Show HN: Dog API
by cube00 on Tuesday December 27, 2022 @10:33AM
(#34149498)
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.
Re:Show HN: Dog API
by rideontime on Tuesday December 27, 2022 @11:40AM
(#34150268)
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.
"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."
Re:Show HN: Dog API
by thangngoc89 on Tuesday December 27, 2022 @12:20PM
(#34150948)
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.
Re:Show HN: Dog API
by kinduff on Wednesday December 28, 2022 @06:01AM
(#34159726)
Long story short: I built the app under my ex-employer Slack, and apps are tied to organizations. When I was removed from the organization, I lost access to the app. Couldn't recover it, I've been trying for years.
Re:Show HN: Dog API
by pfoof on Tuesday December 27, 2022 @04:20PM
(#34153979)
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
Re:Show HN: Dog API
by canadapups on Tuesday December 27, 2022 @04:27PM
(#34154068)
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
Re:Show HN: Dog API
by lioeters on Tuesday December 27, 2022 @05:18PM
(#34154618)
> 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."
Re:Show HN: Dog API
by ragnarok451 on Tuesday December 27, 2022 @08:14PM
(#34156283)
Ok I know it's not in vogue right now but this is actually a good use for the blockchain. Like the database here could just be placed on-chain in a smart contract, and anyone could read it (for free, only writes would cost money) forever, as long as at least one person is operating a node on ethereum. No ongoing hosting or serving costs. Anyone could build an API that did like photo generation or whatever on top of it, and builders could always access the raw data directly.
Re:Show HN: Dog API
by XMPPwocky on Tuesday December 27, 2022 @08:26PM
(#34156386)
You seem to be describing something like a classic P2P content-distribution system - BitTorrent w/ magnet links, IPFS, CoralCDN, etc. Could you explain a bit more what part of your proposal would be incompatible with those existing systems?
Re:Show HN: Dog API
by ragnarok451 on Tuesday December 27, 2022 @08:39PM
(#34156474)
Not too familiar with CoralCDN, will check that out. Would say the comparison with IPFS is apt, BitTorrent though requires people to seed on a per file basis right? so versioning for the source of truth etc becomes tough and you need people to care about your data specifically.
IPFS is an alternate solution, but as addresses are not updatable someone somewhere needs to keep track of where the canonical source is. Further, there is no API built in - the data would live at some address, but someone still needs to construct a way to get it without just downloading the whole data dump at once. Perhaps you shard across different files but that has its own issues.
On chain with Ethereum, you can use a smart contract which allows CRUD operations on the data on a per item basis. The latest version of the smart contract data is clear. The API is basically set with the smart contract - infra to get that has already been built with libraries like ethers, and will continue to be maintained since there are other contracts/products out there that rely on the same infra.
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
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 :)
JSONAPI is too complicated at first, then exactly as complicated as is useful over time.
Of course if you want to use this as a learning project for writing and using APIs... that takes precedence ;-)
Also: is the data open source? Can we contribute to that too, e.g. send a PR?
The main goal is to expose a fun API, and then be as accurate as possible. I'm working on the latter.
[1]: https://github.com/kinduff/dogapi.dog#contributing
[2]: https://github.com/sponsors/kinduff
https://randomuser.me/api/
(I'm writing on an open source tool to help people do this with files in Git repos. https://pypi.org/project/DataTig/#data )
An example on the homepage would be nice. Maybe something about Laika (https://en.wikipedia.org/wiki/Laika)
> 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.
Yes.
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.
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.
(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.)
I've shipped some data in a JSON file bundled with an application, because it didn't change a lot, and we had frequent (biweekly) releases anyway. I mistakenly assumed those two things would always be true.
As time went on, the frequency of necessary changes increased but our overall products release cadence got worse and worse (many months) as the product grew. So customers had continually outdated data.
An additional problem I didn't expect is that since we wanted to get customers the latest data (because the next release was so far out), we had to update the data set as close to release as possible. So always a change at the last minute, which is already a busy time and means it's not really tested well. And also it was extra toil; we had a script for data generation but it still needed a manual run and pull request. In the time I spent running this I could have easily written an API based version several times.
Another problem was that this change had to be made for every release, including bugfix ones. This caused frequent discussion (do we need this?), was forgotten a few times, and caused merge conflicts later which were annoying because in this case the proper way to merge was to ignore both ancestors and rerun the script, which people weren't used to.
Of course I rewrote it eventually (after convincing PM that I need time for this supposedly long done feature again), but then I had to deal with the extra problem of customers who had local customer specific modifications of the file (because that was the workaround our support staff came up with as a way to deal with the outdatedness).
Thankfully, a problem I did not habe was binary data in git. The commits were ugly but at least still got ok diffs (once we sorted the JSON file properly). But you mentioned SQLite, which is not a good match for git. Of course one can work around it by merging the raw SQL, but still, yet another pitfall.
Photos are taken from https://dog.ceo/dog-api/, a similar project.
Can this dog API do that? If so, that would be a huge "selling" point
https://cataas.com/#
https://github.com/Looskie/capybara-api
(The other one seems to give a CDN error these days)
https://gimmeadog.khoanguyen.me/
Wait - maybe not a good name after all.
Would love to hear more about this.
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
> 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...
Sometimes a tiny lil' db is all you need to serve some nice cacheable data :)
IPFS is an alternate solution, but as addresses are not updatable someone somewhere needs to keep track of where the canonical source is. Further, there is no API built in - the data would live at some address, but someone still needs to construct a way to get it without just downloading the whole data dump at once. Perhaps you shard across different files but that has its own issues.
On chain with Ethereum, you can use a smart contract which allows CRUD operations on the data on a per item basis. The latest version of the smart contract data is clear. The API is basically set with the smart contract - infra to get that has already been built with libraries like ethers, and will continue to be maintained since there are other contracts/products out there that rely on the same infra.