Retrieve posts by page in wp rest api

Well, you can add ?page={$page_number} to the URL that you’re requesting. See, for example, http://demo.wp-api.org/wp-json/wp/v2/posts/?page=2. It appears to split the posts into pages of 10. Reference WP-API documentation (I found this in the docs for v1 of the API, but per the sample URL above, it works on v2 as well)

wp_query json ouput

You’re running the query but you’re immediately afterwards printing it out, you need to call the method get_posts or use something like a while statement with have_posts: https://codex.wordpress.org/Class_Reference/WP_Query

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)