Radar API Feedback and Question

I’m excited about the release of the public-use Radar APIs! Just have a little feedback and a few questions about routes.

[Solved, with comment] When calling https://api.cloudflare.com/client/v4/radar/attacks/layer3/timeseries?aggInterval=1d&dateStart=2022-09-01T08:41:43.377Z&dateEnd=2022-10-01T08:41:43.377Z&format=json, I get the error

{
  "errors": [
    {
      "message": "1 validation error: end_time must be before now (utc)",
      "code": "BAD_USER_INPUT"
    }
  ],
  "success": false
}

I have confirmed that the error was due to the timestamps having millisecond values, which they shouldn’t have. It would be nice for the error message to be different, if possible. Maybe Malformed end_date. Value must be UTC String with second precision, would that be good?

Secondly, I was wondering if there are, or are plans for, API routes serving Traffic Trends


which I would assume would go under Radar HTTP, and Domain Categorization

which might fall under Radar Ranking, though that one might be better if it were called Radar Domains. It also might be possible that these routes do, in fact, exist, and I am just blind. If so, I sincerely apologize for the trouble!

Lastly, in the Domain display box shown above, it would be nice if the Domain Name were displayed in large text, just to easily know what domain it pertains to, maybe like so:


(Though there is probably someone who could make it look a lot better, as this is just a quick sketch made by a dev that isn’t very good at web design, I’m trying to change that.)

All in all though, great revamp, and can’t wait to see where y’all will take it next!

Hello,

Thanks for the heads up. We’ll improve the error message!

Regarding “Internet Traffic Trends”, they’re available at the netflows endpoint (Cloudflare API v4 Documentation), which includes all network traffic (eg. HTTP requests, DNS queries to 1.1.1.1, etc). Radar HTTP only includes HTTP traffic to our zones and is a more specialized dataset.

Regarding domain categorization, there Radar uses another pre-existing CF api, Cloudflare API v4 Documentation.

Thanks for the other suggestions, I’ll pass them on the design team.

Nice, thank you for your reply!
Hope you have a nice day!

Hi scardita!

Just reopening this to ask about the format the API uses for arrays in a Query String. On the Netflows API that you mentioned, it shows the product field as an Array of network traffic product types., though it isn’t 100% clear exactly how to encode an array within a Query String, as far as I’m aware, there isn’t a standard format for this.

So far, I have tried:

https://api.cloudflare.com/client/v4/radar/netflows/timeseries?aggInterval=1d&dateStart=2022-09-06T20:53:27&dateEnd=2022-10-07T07:23:27&product=["all","http"]
https://api.cloudflare.com/client/v4/radar/netflows/timeseries?aggInterval=1d&dateStart=2022-09-06T20:53:27&dateEnd=2022-10-07T07:23:27&product=[all,http]
https://api.cloudflare.com/client/v4/radar/netflows/timeseries?aggInterval=1d&dateStart=2022-09-06T20:53:27&dateEnd=2022-10-07T07:23:27&product=all,http
https://api.cloudflare.com/client/v4/radar/netflows/timeseries?aggInterval=1d&dateStart=2022-09-06T20:53:27&dateEnd=2022-10-07T07:23:27&product=all&product=http
https://api.cloudflare.com/client/v4/radar/netflows/timeseries?aggInterval=1d&dateStart=2022-09-06T20:53:27&dateEnd=2022-10-07T07:23:27&product[]=all&product[]=http

without success. These have thrown two different errors:

{
  "errors": [
    {
      "message": "You must send either range or start & end dates"
    }
  ],
  "success": false,
  "result": {

  }
}

and

{
  "errors": [
    {
      "message": "Server Error"
    }
  ],
  "success": false,
  "result": {

  }
}

both of which aren’t very useful in figuring out the required format. It would be helpful if you could point me in the right direction to be able to get both products at the same time.

Hi Alastair,

We’re working in improving the error messages and general documentation but the idea for the arrays is that you can request multiple series at the same time, so they can be compared with each other (we don’t return raw values, the values returned are normalized using min-max, setting the min to 0). There’s a small intro at the beginning of each section that tries to explain this. For example, to compare all network traffic to only http network traffic, you would do:

https://api.cloudflare.com/client/v4/radar/netflows/timeseries?name=all&aggInterval=1d&dateStart=2022-09-06T20:53:27&dateEnd=2022-10-07T07:23:27&product=all&name=http&aggInterval=1d&dateStart=2022-09-06T20:53:27&dateEnd=2022-10-07T07:23:27&product=http

So the params for 1st series would be:

name=all&aggInterval=1d&dateStart=2022-09-06T20:53:27&dateEnd=2022-10-07T07:23:27&product=all

and for the second, they would be:

name=http&aggInterval=1d&dateStart=2022-09-06T20:53:27&dateEnd=2022-10-07T07:23:27&product=http

name is optional, if omitted, series will be named series_0, series_1, etc.

In the example you’ve shown, you would do:

https://api.cloudflare.com/client/v4/radar/netflows/timeseries?name=all&aggInterval=1d&dateStart=2022-09-06T20:53:27&dateEnd=2022-10-07T07:23:27&product=all

Or just omit the product since all is the default (it includes all products, http and others).

Thanks for your help, scardita!
The documentation update would be very much appreciated.
Have a nice day!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.