4
8 Comments

API question - overlaying a master API

I have a number of APIs that fetches different information. Over time, the list grew. Is it a weird idea to have a "master" API end-point that is user-facing and fetches the different data required or still keep to issuing many APIs?

What I meant is having this master API somewhat as a "router" rather than re-coding a heavy API.

  1. 2

    I don't think that's weird, I think it can even be a good practice to have some layer of abstraction between in front of third-party APIs.

  2. 1

    What you explain is a common scenario, Look up API gateways and some allow you to "compose" apis from your existing API endpoints too. Tyk is a good open source API gateway.

  3. 1

    thanks for all the advice!

  4. 1

    If https://www.onegraph.com/ has a whole business model around it, you can also have a master API.

  5. 1

    As long as your API is well structured I'd contend that they are the same thing and it doesn't really matter.

    Your client is requesting a specific service or piece of data and needs to define what it wants such that your server knows how to route it. That routing can be at the url level if the API is REST-based, or you can have a generic /api but then that single endpoint needs to be passed the same information as would be required via REST!

    Either way, given the growth of the api surface area, it could be a good time to refactor to make everything consistent.

  6. 1

    It's not unusual to have small "internal" services serving specific APIs to each others, and one client facing API. It's also easier to manage the security for outside connections in one API vs many.

  7. 1

    You really need to have a concise and understandable client facing API and it doesn't matter if all these APIs are behind the same service/router/gateway. You can have many different services each providing a different API, as long as the experience for users is pristine. For example, release an SDK in relevant languages that handles the switch between services. Then you don't need the overhead of a router. Having a router is unnecessary expense that you never get back. It's a waste to make and a waste to maintain and a waste in performance in use.

  8. 1

    It's hard to give specific input without knowing the specifics of your APIs, but I think it often makes sense to have a single entry point for all of your APIs like /api.

Trending on Indie Hackers
Aim to be valuable and you'll be indispensable. 24 comments I made $804 in February 20 comments How hard should you work? 16 comments NFTs are a dangerous trap 12 comments Songbox - finally - breaks $1000 MRR 7 comments Tesla closes its forums and raises the anger of fans 6 comments