GraphQL API Overview

Graphic Query Language (GraphQL) is a language created for use with APIs. It works as an alternative to REST APIs, allowing you to get data according to your needs. GraphQL gives you autonomy to request the data you want and receive exactly what you asked for through a JSON result.

As GraphQL fetches information differently from traditional APIs, it assists you in filtering data without overfetching. The precise response it provides also gives a better performance to those using GraphQL and makes it easier to use. Another difference from other APIs is that it has a single endpoint.

You can use the two Azion GraphQL APIs to perform a logpull of your data and maximize your analysis through:

More on aggregated and raw data

You can also use the financial GraphQL APIs:

  • Billing GraphQL API, which provides data related to bills, type of financial entries, and payments.
  • Accounting GraphQL API, which provides data related to products and its metrics being accounted in the client’s account.

With the Real-Time Metrics GraphQL API, you can, for example:

  • Investigate where security threat requests come from, including bot traffic and management (if subscribed).
  • Get IPs with most requests.
  • See domains with the least requests.
  • Analyze the number of requests using HTTP methods.
  • Consult the number of users currently connected to your live streamings.
  • Find hosts with the most requests.

With the Real-Time Events GraphQL API, you can, for example:

  • View top IPs that generate most requests.
  • View top URIs that receive most requests.
  • See blocked requests by IP or country.
  • View top user agents.
  • View top IPs by request method.

In addition, you don’t need a specific database, framework, or programming language to use GraphQL. You can use it with the code and data you’re already used to. The API relies on queries to access your data and information and filter what you need.

Even if you’ve already made a request, you can change, delete, or add more information with a simple modification in your query.

Here’s an example of what a query looks like:

query HttpQuery {
httpMetrics(
filter: {
tsRange: {begin: "2022-03-21T10:10:10", end: "2022-09-23T10:10:10"}
}
)
{
ts
geolocCountryName
geolocRegionName
}
}

And here’s an example of what the JSON response will look like:

{
"data": {
"httpMetrics": [
{
"ts": "2022-10-21T15:00:00Z",
"geolocCountryName": "Canada",
"geolocRegionName": "Quebec"
},
{
"ts": "2022-10-21T14:00:00Z",
"geolocCountryName": "Brazil",
"geolocRegionName": "Parana"
}
]
}
}

By using queries in Azion GraphQL APIs, you can request both raw and aggregated data.

If you request the aggregated data model, the API will fetch your data according to a predefined interval of minutes, hours, or days.


Contributors