TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What are the most enjoyable REST APIs you've used?

2 pointsby wkoszekover 6 years ago
I want to take a look at some great REST APIs as a reference. I'm looking to see how stuff like authorization, querying, filters have been implemented etc. SimpleDNS and Stripe look nice. Anything else?

3 comments

KajMagnusover 6 years ago
&gt; authorization<p>Hmm. Is authorization maybe very app specific? Did you mean <i>authentication</i>?:<p>Basic Authentication and API keys and HTTPS seems popular. E.g. Stripe: <a href="https:&#x2F;&#x2F;stripe.com&#x2F;docs&#x2F;connect&#x2F;authentication#api-keys" rel="nofollow">https:&#x2F;&#x2F;stripe.com&#x2F;docs&#x2F;connect&#x2F;authentication#api-keys</a>, and Chargebee (they deal with tons of money).<p>I like this article: <a href="https:&#x2F;&#x2F;www.vinaysahni.com&#x2F;best-practices-for-a-pragmatic-restful-api" rel="nofollow">https:&#x2F;&#x2F;www.vinaysahni.com&#x2F;best-practices-for-a-pragmatic-re...</a> — except that I use only POST and GET, never PUT, DELETE etc. And name the endpoints like:<p><pre><code> POST &#x2F;-&#x2F;create-page controllers.PageController.createPage POST &#x2F;-&#x2F;pin-page controllers.PageController.pinPage POST &#x2F;-&#x2F;unpin-page controllers.PageController.unpinPage POST &#x2F;-&#x2F;reply controllers.ReplyController.handleReply GET &#x2F;-&#x2F;load-draft-and-guidelines controllers.EditController.loadDraftAndGuidelines GET &#x2F;-&#x2F;load-draft-and-text controllers.EditController.loadDraftAndText POST &#x2F;-&#x2F;edit controllers.EditController.edit </code></pre> then one knows what and endpoint does, by just looking at the URL path. Won&#x27;t also need to ask: &quot;But which method?&quot;<p>Also, most people that actually design APIs, seem to put the API version in the URL, like `&#x2F;api&#x2F;v1&#x2F;...`.
评论 #18137604 未加载
nobody271over 6 years ago
Not Facebook. Not Disqus either. Not Google sheets. Oh, yeah, and definitely not Ebay.<p>To me a good REST API makes getting started easy. If I spend the first few hours with your framework trying to get oauth setup that&#x27;s not a good sign.<p>Second way, imo, to design a good API is to not be pretentious. We should be able to guess where to look for things without having to learn any $5 words.<p>A good interaction to get a users photos should look like this:<p>- &#x2F;get-all-photos&#x2F;userId<p>That returns a JSON object with everything you need to know about the users photos.<p>For example: the ONE url to the photo, title, caption<p>Oh, and no paging and dont you EVER phone home in some weird alien way (embed a .gif to communicate, what?)!
评论 #18137603 未加载
Rjevskiover 6 years ago
The Twitter API back in 2013 before they destroyed it.