I recommend that you use the data explorer plugin and Run Data Explorer queries with the Discourse API; it sort-of allows you to generate your own API endpoint (to retrieve data explorer data).
Are you requesting as a user that can read those notes?