Using reporting API

I am trying to get all the urls and related custom variables that is stored when visitor view the page. I am new to piwik and I can’t find a way to do it. Can anybody help me? Thanks in advance

Waiting for answer. Can anyone answer it please?

I think you can get it by exporting the visitor log screen. Page urls and custom variables belonging to a single visit will be in multiple columns.
If you just want these specific columns, try reporting with pivots by userid. I havent tried pivot feature.
The other option is develop custom report - Guide could be found in

Thanks @yarafatin for your answer but I am finding difficult to use the api. Can you please give me an example. Thanks!

What are you trying to achieve?
If you just want an excel or Json with URLs and custom variables per visit, you can go to the Visitor log screen and export the result.
If you want an HTTP URL, just mouse over the export link and get the URL.
If you are developing a PHP module, just follow the guide starting from Setting Up: Develop - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3 guide