Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    V

    Vinay Sahni

    vinaysahni.com · Personal blog · on HN since 2013

    Vinay Sahni, a software engineer and founder, writes on API design, microservices, and running SaaS products.

    Visit blogHN submissions
    Web DevelopmentProgramming
    What HN says

    HN commenters repeatedly point to his pragmatic RESTful API guide as a helpful starting point for API design, in discussions of REST conventions and best practices.

    Stats for nerds
    29HN people shared it
    18linked in comments
    917story points
    Jun 2023last shared
    2013people per year2023

    Top posts on HN

    1. 1
      Designing a Pragmatic RESTful API
      22 people · 747 points · first shared 2013 · 132 comments on HN
    2. 2
      Writing Effective Welcome Emails
      1 person · 132 points · first shared 2013 · 75 comments on HN
    3. 3
      Best Practices for Building a Microservice Architecture
      6 people · 34 points · first shared 2016 · 2 comments on HN
    4. 4
      What to Do When Google Decides Your SaaS Is Dangerous
      1 person · 4 points · first shared 2021 · 2 comments on HN
    5. 5
      Url]
      1 person · first shared 2013
    6. 6
      How google inflates adwords bids
      1 person · first shared 2013
    7. 7
      How to choose the right technology
      1 person · first shared 2020

    What HN people wrote when they linked it

    • FlenserOct 2014

      You may find some of these helpful:

      • Web API Design Crafting Interfaces that Developers Love - eBook [APIGEE]

      • How to design an API function that creates something [SHAREDOM] [SHAREDOM-HN]

      • Microservices and the First Law of Distributed Objects [FOWLER] [FOWLER-HN]

      • Lego’s API Strategy: Resourcing Developers and Building a Business Case [LEGO]

      • A review of all most common API editors — Medium [ORLIESAURUS] [ORLIESAURUS-HN]

      • Best Practices for Designing a Pragmatic RESTful API [VINAYSAHNI] [VINAYSAHNI-HN1] [VINAYSAHNI-HN2]

      • Best practices for API versioning? - Stack Overflow [SO] [SO-HN]

      • Designing Hypermedia APIs [KLABNIK]

      [APIGEE] https://pages.apigee.com/web-api-design-ebook.html

      [SHAREDOM] http://sheredom.wordpress.com/2014/08/10/how-to-design-api-function-that-creates-something/

      [SHAREDOM-HN] https://news.ycombinator.com/item?id=8160071

      [FOWLER] http://martinfowler.com/articles/distributed-objects-microservices.html

      [FOWLER-HN] https://news.ycombinator.com/item?id=8172980

      [LEGO] http://nordicapis.com/legos-api-strategy-resourcing-developers-building-business-case/

      [ORLIESAURUS] https://medium.com/@orliesaurus/a-review-of-all-most-common-api-editors-6a720dc4f4e6

      [ORLIESAURUS-HN] https://news.ycombinator.com/item?id=8505244

      [SO] http://stackoverflow.com/a/398564/2541

      [SO-HN] https://news.ycombinator.com/item?id=7350432

      [VINAYSAHNI] http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api

      [VINAYSAHNI-HN1]…

    • KajMagnusOct 2018

      > authorization

      Hmm. Is authorization maybe very app specific? Did you mean authentication?:

      Basic Authentication and API keys and HTTPS seems popular. E.g. Stripe: https://stripe.com/docs/connect/authentication#api-keys, and Chargebee (they deal with tons of money).

      I like this article: https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api — except that I use only POST and GET, never PUT, DELETE etc. And name the endpoints like:

      POST /-/create-page controllers.PageController.createPage
      POST /-/pin-page controllers.PageController.pinPage
      POST /-/unpin-page controllers.PageController.unpinPage
      POST /-/reply controllers.ReplyController.handleReply

      GET /-/load-draft-and-guidelines controllers.EditController.loadDraftAndGuidelines
      GET /-/load-draft-and-text controllers.EditController.loadDraftAndText
      POST /-/edit controllers.EditController.edit

      then one knows what and endpoint does, by just looking at the URL path. Won't also need to ask: "But which method?"

      Also, most people that actually design APIs, seem to put the API version in the URL, like `/api/v1/...`.

    • WhitneyLandAug 2016

      1) Does all this depend on use case? Yes, heavily. Best practices are needed, but final design choices are tailored.

      2) I don't like dup query params, it's not well defined: http://stackoverflow.com/questions/1746507/authoritative-position-of-duplicate-http-get-query-keys

      For returning multiple types at once there are a few common strategies.

      For related types some APIs offer an "include" or "embed" approach like this: http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#autoloading

      Another approach is to support a query syntax for items, where items is a container record for multiple possible types.

      If a certain multi-type scenario super common you may want build the concept into the API itself as basic functionality.

      Again, your final choice should be as simple as possible but no simpler, taking into account ease of use, performance, etc.

    • perlwleMar 2022

      https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api

      Helped me get started with API design in my early career. Learning from other existing APIs helps too. such as stripe, github, shopify. Any others?

      Something that We do at my current job:

      * set a standard and stick with it. tweak it if needed. we even have naming standard on some of the json key. for example, use XXX_count for counting. when it doesn't make sense, use total_XXX.

      * Document your API, we use postman and code review API changes too.

    • cel1neSep 2020

      Use REST for reading, but RPC-style calls for writing.
      Benefits:

      1. Every write-call is a transaction

      2. You can have complex filtering and sorting in the read/access side of your API without having to worrying about the update-side of things.

      3. You can evolve the read-API, even change semantics and return different objects and again, not worry about transactions.

      4. You are not limited to the HTTP-standard.

      Here are also some good tips: https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api

    • jobuNov 2014

      Here are a couple more lists of Best Practices for REST APIs.

      http://blog.mwaysolutions.com/2014/06/05/10-best-practices-for-better-restful-api/

      http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api

      The Github team does a pretty good job of incorporating modern best practices as well, so I often use their API as a reference: https://developer.github.com/v3/

    Related

    Yegor Bugayenkoyegor256.com116 people

    Why I Don’t Talk to Google Recruiters

    Yegor Bugayenko
    Personal · last shared 2025
    antirezantirez.com456 people

    The End of the Redis Adventure

    antirez
    Personal · last shared 2026
    Khoi Vinhsubtraction.com116 people

    Ad Blocking Irony

    Khoi Vinh
    Personal · last shared 2026
    API Evangelistapievangelist.com59 people

    Let Developers Register for Your API with Their Github Profile

    API Evangelist
    Personal · last shared 2019
    Airbnb Engineeringnerds.airbnb.com110 people

    We've Open-sourced Rendr

    Airbnb Engineering
    Company · last shared 2017
    Chris Richardsonmicroservices.io58 people

    A pattern language for microservices

    Chris Richardson
    Personal · last shared 2026
    Pinterest Engineeringmedium.com/@pinterest_engineering70 people

    Three-day no-meeting schedule for engineers

    Pinterest Engineering
    Company · last shared 2026
    Dare Obasanjo25hoursaday.com71 people

    Why are Amazon, Facebook and Yahoo copying Microsoft's stack ranking system?

    Dare Obasanjo
    Personal · last shared 2025