I have worked it out for average response time and throughput data from this resource: https://api.newrelic.com/docs/#/
But it doesn't show anything about %95, %99, Average and Median response times, which are the most important ones in my case. Does this REST API somehow give these data? Or NRQL from New Relic web interface is the only way to get these? I need this for reporting reasons.
You can execute any NRQL you want, like you used to do in the Web UI, using the NerdGraph API. NerdGraph API even gives you the ability to do some things you can't do from the UI, such as query across multiple accounts, and run asynchronous queries.
See more information about executing NRQL using NerdGraph API here.