DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • From APIs to Event-Driven Systems: Modern Java Backend Design
  • How Developers Are Driving Supply Chain Innovation With Modern Tech
  • Exploring Intercooler.js: Simplify AJAX With HTML Attributes
  • APIs for Logistics Orchestration: Designing for Compliance, Exceptions, and Edge Cases

Trending

  • Building AI-Powered Java Applications With Jakarta EE and LangChain4j
  • Building Threat Intelligence Pipelines Using Python, APIs, and Elasticsearch
  • 5 AI Security Incidents That Broke Things in Production (and What They Have in Common)
  • GenAI Implementation Isn't Magic — It’s a Lifecycle
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. API Quota API, Webhooks, and Server-Sent Events (SSE)

API Quota API, Webhooks, and Server-Sent Events (SSE)

An API quota API is useful for when you depend on a single API but is something that becomes almost critical when it comes to depending on many APIs

By 
Kin Lane user avatar
Kin Lane
·
Feb. 14, 18 · Opinion
Likes (6)
Comment
Save
Tweet
Share
8.5K Views

Join the DZone community and get the full member experience.

Join For Free

I am profiling market data APIs as part of my partnership with Streamdata.io. It is a process I enjoy because it provides me with a number of interesting stories I can tell here and on API Evangelist. Many of the APIs I profile just frustrate me, but there are always the gems who are doing interesting things with their APIs and understand providing APIs as well as consuming APIs. One API that I’ve been profiling, and I am able to put to use in my work to build a gallery of real-time data APIs, was 1Forge.

1Forge provides dead simple APIs for accessing market data, and surprise(!) – you can sign up for a key, and begin making API calls within minutes. It might not sound like that big of a deal, but after going through 25+ APIs, I only have about 5 API keys. I’m working on an OpenAPI definition for 1Forge, so I can begin to poll, and stream the data they make available, including it in the Streamdata.io API gallery I’m building. However, as I was getting up and running with the API, I noticed their quota endpoint, which allows me to check my usage quote with the 1Forge API –something that I thought was story worthy.

The idea of an endpoint to check my applications usage quota for an API seems like a pretty fundamental concept, but sadly it is something I do not see very often. It is something that should be the default for ALL APIs, but, additionally, I’d like to see a webhook for letting me know when my API consumption reaches different levels. Since I’m talking about Streamdata.io, it would also make sense to offer a Server-Sent Event (SSE) for the API quote endpoint, allowing me to bake the usage quota for all the APIs I depend on into a single API dashboard – streaming the real-time usage information that the APIs depend on and maybe displaying things in RED when I reach certain levels.

An API quota API is useful for when you depend on a single API but is something that becomes almost critical when it comes to depending on many APIs. These are one of those APIs that API providers are going to need to realize has to be present by default for their API platforms. It is something that can keep us humans in tune with our consumption, but more importantly can help us programmatically manage our API consumption, and adjust our polling frequency automatically as we reach the limits of our API access tier, or even upgrade as we realize our rate limit constraints are too tight for a specific application. I’m going to add an API quota API to my list of default administrative APIs that API providers should be offering. Updating the default set of resources we should have available for ALL APIs we are operating.

API Server-sent events Webhook Event

Published at DZone with permission of Kin Lane. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • From APIs to Event-Driven Systems: Modern Java Backend Design
  • How Developers Are Driving Supply Chain Innovation With Modern Tech
  • Exploring Intercooler.js: Simplify AJAX With HTML Attributes
  • APIs for Logistics Orchestration: Designing for Compliance, Exceptions, and Edge Cases

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook