▲ 0 r/django

How do you handle multi-API integration with different auth methods? Here is my approach.

Hey everyone,

I’ve been working on a project that requires integrating multiple third-party APIs, each using a different authentication method (OAuth2, API Keys, Basic Auth, custom tokens, you name it).

To keep the codebase clean and avoid auth logic bleeding into my business logic, I built a custom API abstraction layer.

Here’s a quick breakdown of how it works:

  • Registration: I register each API and its required auth method in a central config/registry.
  • The Wrapper: A unified layer handles the token refreshing, header injections, and signature generation behind the scenes.
  • The Call: In my actual application code, I just call the abstraction layer (e.g., apiClient.fetch('serviceName', endpoint)), and it automatically handles the specific auth handshake.

It’s working great so far and keeps everything decoupled, but I’m curious about how others tackle this as the project scales.

What’s your go-to approach? > * Do you build custom wrappers like me?

  • Do you rely on specific design patterns (like Gateway or Factory)?
  • Or do you use a third-party library/tool to manage this overhead?

Let’s discuss!

reddit.com
u/ELMG006 — 2 days ago

How do you manage the monitoring and logging of the APIs you integrate into your projects?

I use an API Abstraction Layer specialized in machine-to-machine API calls through which all my APIs pass, and this tool allows me to monitor and log all the activity of my APIs via the dashboard. The logs also allow me to see in real time which API the method is using and the response format sent (200, 404, 500, etc.). I use a self-hosted version of this tool, a bit like a support tool for projects, a bit like an adapter. What's more, the strength of this tool is that it handles several types of API authentication, notably API Keys, and almost all Auth 2.0 flows. So when one of the APIs I use switches from API Keys to Auth 2.0, I just have to change the authentication method in this tool, run tests to see if it responds correctly, and validate the changes. That's it. As for cleaning the JSON data, formatting, etc., and the business logic of my application, the tool doesn't take that into account; I manage that myself. If you have any suggestions, I'm open to discussion.

reddit.com
u/ELMG006 — 1 month ago
▲ 0 r/django

Do you ever directly consume APIs for purely personal use?

Yes, I do, and to do that I use software where I simply record the characteristics of the APIs I want to use via a dashboard. Then, through a dynamic interface, I can use them simply by dynamically filling in the parameter fields I've defined. For your information, I created this software myself and I've made available its SaaSopen-source version (which is really focused on the API itself, the software acting as a single API to call all the other APIs in your project), and also a dedicated subreddit for those who have questions.

reddit.com
u/ELMG006 — 1 month ago

Do you have generic functions to execute several different APIs in your projects, or do you code the functions as you go to call your APIs?

I have a backend filled with generic functions to call and execute various types of APIs. So, when I want to integrate APIs into my different projects, I register them in my backend and then call them via the backend's API. I coded my backend with Django, PostSQL, and Djange DRF. I'd like to know what you use.

reddit.com
u/ELMG006 — 1 month ago

In your various projects, how do you manage your automations when you want to change APIs?

In my case, to avoid having to modify my workflows, I save all my APIs in a single API and use it to call them all. That way, when I want to change or modify an API, I just go to my API dashboard and make the changes there without ever having to touch my automations. This API can execute all types of REST APIs, as well as those that work with API keys and Auth 2.0 authentication, and it also monitors errors and logs in real time so I always know where and why things are failing, allowing me to quickly make changes in my dashboard. I'm eager to know how you handle these kinds of situations.

reddit.com
u/ELMG006 — 1 month ago

In your various app projects, have you ever been frustrated by having to go back into your code just to change or modify your APIs?

Yes, me too. So, all alone in my corner with Django, PostSQL, and Django DRF, I created a mini Gateway API specialized in calling external APIs. So I have all the advantages of Gateway APIs: monitoring, error handling, limit management, dashboards, etc., but specifically for managing external APIs. Therefore, in my apps, I only use my gateway, and when I want to change or modify my APIs, I only go to the dashboard of my Gateway API and I only touch my code to change my business logic. Of course, going through an intermediary to make my calls adds a slight latency, but honestly, for small projects, the latency isn't even noticeable for me or my end users. I'm eager to see how you handle this if you've ever experienced this frustration.

reddit.com
u/ELMG006 — 2 months ago

In your projects, how do you integrate multiple APIs with different authentication methods?

I use a Slack workspace built with Django and DRF where I put all my functions and classes to call and manage different types of APIs, and then I just have to go through this Slack workspace to call my different APIs. What about you?

reddit.com
u/ELMG006 — 2 months ago

What technique do you use in your projects when you have to use APIs that don't have the same response format in your projects?

I use a proxy that I developed myself, and it's this proxy that handles executing the APIs on other servers. All I have to do is register the different APIs and their characteristics in my proxy (URLs, endpoint, method, parameter type, etc.). Then, all I have to do is integrate my proxy's API into my code, specify which API, how, and which part of the API I want to call to my proxy, and choose the same response format for all my APIs. Then, my proxy handles reconstructing and executing the requests on its servers using the API data I've registered, retrieving the responses, cleaning them, and formatting them before sending them back to my project. I'm curious to see what you use or have developed for this type of problem in particular.

reddit.com
u/ELMG006 — 2 months ago

I built an open-source outbound API gateway in Django + DRF.

Main idea:

* register third-party APIs once,

* expose them through a unified REST interface,

* handle OAuth2, quotas, throttling, and logging centrally.

It supports:

* OAuth2 flows

* per-user quota system

* API key auth

* endpoint modeling

* request logging

* DRF throttling

* self-hosted deployment

I originally built it because I got tired of re-implementing API integrations and rate limiting logic across projects.

Would love feedback on:

* architecture

* quota design

* OAuth token handling

* API modeling approach

Repo:

https://github.com/botyut/asstgr

u/ELMG006 — 1 month ago

Built Asstgr, an open-source outbound API gateway using Django and DRF. Register third-party APIs once, manage OAuth2, quotas, API keys, throttling, and execute everything through a unified REST interface. https://github.com/botyut/asstgr

u/ELMG006 — 2 months ago
▲ 9 r/developer+4 crossposts

Built an open-source outbound API gateway in Django/DRF.

​

The idea started after getting tired of re-implementing the same things every time I integrated third-party APIs:

* auth handling

* OAuth token refresh

* rate limiting

* quotas

* logging

* endpoint wrappers

* response formatting

So I built **Asstgr**: a self-hosted platform where you register external APIs once, define endpoints/params/methods, and then access everything through a unified REST interface.

Architecture is basically:

`Your App -> Asstgr -> Stripe/GitHub/OpenWeather/etc`

Features:

* OAuth2 (`client_credentials`, `authorization_code`, `password`)

* API key auth (`sk-...`)

* per-user quota system

* DRF throttling

* endpoint modeling

* audit logs

* unified `/execute/` endpoint

* response formatting modes

* Django admin support

* PostgreSQL + ASGI stack

One thing I wanted was to make external APIs behave more like internal services instead of every project having bespoke integration code.

Tech stack:

* Django 5

* Django REST Framework

* PostgreSQL

* Daphne / Channels

* SimpleJWT

It’s fully open source (MIT), and I also built a hosted SaaS version with a UI layer on top because the admin-only workflow wasn’t great for daily use.

Open source:

https://github.com/botyut/asstgr

Hosted version:

https://www.asstgr.com/home/

Would genuinely love feedback from people who’ve built internal API platforms / gateways before — especially around:

* schema design

* quota systems

* OAuth architecture

* execution abstraction

* scaling concerns

Curious if others ended up building similar internal tooling instead of using RapidAPI / Kong / Tyk / etc.

u/ELMG006 — 2 months ago

Built a self-hosted outbound API gateway with Django + DRF

​

Hey everyone,

I’ve been working on a project called Asstgr: a self-hosted outbound API gateway built with Django REST Framework.

The idea is simple:

instead of integrating third-party APIs directly into every app, you register them once in Asstgr and access them through a unified REST interface.

Think of it like a private/self-hosted RapidAPI layer.

Main features:

* API registry for any external API

* Endpoint + parameter modeling

* OAuth2 support (client_credentials, authorization_code, password)

* Automatic token refresh

* API key authentication

* Per-user quota system

* DRF throttling / rate limiting

* Unified execute endpoint

* Request logging + audit trail

* Multiple response formatting modes

* Django admin back-office

Stack:

* Django 5

* Django REST Framework

* PostgreSQL

* Daphne / ASGI

* SimpleJWT

Example flow:

Your app → Asstgr → Stripe / GitHub / OpenWeather / etc.

One thing I wanted to solve:

when you manage lots of third-party integrations, auth handling, quotas, retries, logging, and normalization become repetitive very quickly.

So I tried turning that into a reusable platform.

GitHub:

https://github.com/botyut/asstgr

SaaS demo:

https://www.asstgr.com/home/

I’d love feedback from backend engineers:

* architecture

* API design

* quota/throttling strategy

* OAuth implementation

* ideas for improvement

Especially interested in opinions about whether Django is a good fit for this kind of gateway architecture long term.

reddit.com
u/ELMG006 — 2 months ago

In my executor, you can record the characteristics of your APIs (URLs, endpoints, methods, parameters, authentication, etc.) via the executor's API or its web interface, and then call them all using the single URL of my software's API. You can also monitor the logs of your calls and even test your APIs. For those who are curious, all the links are in my bio. Thank you for reading.

reddit.com
u/ELMG006 — 2 months ago