Skip to content
Notifications
Clear all

Help: API returns different data than the UI. Which is correct?

5 Posts
5 Users
0 Reactions
1 Views
(@gregoryp)
Estimable Member
Joined: 2 weeks ago
Posts: 78
Topic starter   [#21762]

I am conducting an analysis of our cloud asset inventory and have encountered a persistent discrepancy between data presented in the InsightCloudSec UI and data retrieved via its REST API. Specifically, the count and metadata for a particular resource type—in this case, unattached persistent disks in Google Cloud Platform—do not align. The UI's "Governance" view, filtered for `resource.type = 'compute.disk'` and `status = 'unused'`, reports a significantly lower number of assets than when I query the `/v2/resources` API endpoint with logically equivalent filters.

This inconsistency raises a fundamental question of data integrity: which source should be considered the system of record? For platform engineering and FinOps workflows, we rely on accurate, machine-readable data via API to drive automated cleanup jobs and cost reporting. A discrepancy undermines both trust and automation.

To illustrate, here is a simplified version of the API call I am making, focusing on the key parameters:

```bash
curl -X GET
'https://us.api.insight.rapid7.com/cloud/v2/resources?cloud.type=gcp&resource.type=compute.disk&state.status=unused&size=100'
-H 'Authorization: Bearer $API_TOKEN'
```

The JSON response contains a `metadata.total_resources` count that is approximately 40% higher than the count shown in the UI for the same conceptual filter set. I have validated the following:

* The API token has the same permissions as my UI account (full read access).
* I have accounted for pagination (`size` and `page` parameters) to ensure I am capturing the full result set.
* The time window for the data is equivalent; I am not comparing real-time API data against a stale UI cache (the UI also shows "Data Current As Of" a recent timestamp).

Potential hypotheses I am exploring, but have not yet confirmed, include:

* **UI Filter Logic:** The UI's "unused" filter may incorporate additional, undocumented business logic (e.g., disks created within the last 24 hours are excluded) that is not directly translatable to the API's `state.status` field.
* **API vs. UI Data Pipeline:** There might be a latency or processing difference between the data pipelines serving the API and those serving the UI's aggregated views.
* **Filter Scope Misinterpretation:** The `state.status` filter in the API might encompass a broader set of sub-states than the UI's consolidated "unused" view.

Has anyone else performed a similar data reconciliation and identified the root cause of such discrepancies? More importantly, is there documented guidance from Rapid7 on validating API data against the UI, or which source is prioritized for accuracy? For Infrastructure as Code and cost optimization purposes, the API's output is critical, and this inconsistency currently blocks us from fully operationalizing the tool.


infra nerd, cost hawk


   
Quote
(@cloud_migrate_tom)
Estimable Member
Joined: 4 months ago
Posts: 95
 

Oh man, that's a tricky one. I've run into similar issues during our lift-and-shift where the dashboard and the API were telling different stories. In our case, it turned out the UI was applying some extra internal logic for the "Governance" view that wasn't reflected in the raw API filters, like a date filter on the last scan.

Which source is correct? For our automation scripts, we had to treat the API as the source of truth, but it really depends on what that "unused" status means to your process. Maybe the API shows all disks flagged as unused by the system, while the UI only shows ones that have been in that state for a certain period? Have you checked if there's a time-based filter baked into the Governance view that you can't see?


One step at a time


   
ReplyQuote
(@baller_analytics)
Estimable Member
Joined: 2 months ago
Posts: 143
 

"Had to treat the API as the source of truth" is a common but dangerous cop-out. It just shifts the question from "what's correct?" to "which API endpoint?"

The real system of record is usually the raw scan data, not a presentation layer API. The API and the UI are both clients. If they're giving different counts, both are probably applying logic you can't see, which makes both untrustworthy.

Your FinOps workflow needs the *actual* unused disk list for costing, not the API's convenience output. Push the vendor to document the discrepancy or give you direct access to the scan results. Otherwise you're just automating on bad data.


If it's not a retention curve, I don't care.


   
ReplyQuote
(@cost_analyst_ray)
Reputable Member
Joined: 5 months ago
Posts: 154
 

Your core question about which source is the system of record for FinOps is the critical one. I'd treat both as potentially incorrect for cost purposes until you validate against raw billing data. The API's higher count likely includes disks recently detached or in transient states that the UI's governance logic excludes, perhaps based on a time threshold.

Have you run a parallel query in GCP's own billing export or Compute Engine API, filtered for disks with `users` empty? That number is your actual financial truth. If the InsightCloudSec API count matches GCP's raw count, then the UI is applying business logic. If it doesn't, then the API's "unused" filter has its own problems. You need a third data source to triangulate.


CostCutter


   
ReplyQuote
(@danielr)
Estimable Member
Joined: 2 weeks ago
Posts: 75
 

Triangulating with GCP's own data is sensible, but calling it your "actual financial truth" is a stretch. The billing export is just another abstraction with its own delays and categorization quirks.

You're creating a third point of failure, not finding truth. If all three sources differ, you're just stuck with three bad answers instead of two. The real problem is the vendor's opaque data pipeline, and no amount of cross-referencing fixes that.

Instead of spending cycles on a three-way validation, demand the vendor explain the logic gap between their UI and API. Their documentation should be the source of truth, not your detective work.


Trust but verify.


   
ReplyQuote