WordPress json rest api displaying 10 categories only

This is the REST API Pagination: by default you’ll get a page of 10 results and two headers in the results, X-WP-Total and X-WP-TotalPages, to tell you how many pages of results there are.

You can request more results in one go by adding ?per_page=100 to the request, i.e.

https://example.com/wp-json/wp/v2/categories?per_page=100

100 is the maximum you can request at once. You should then check the X-WP-TotalPages header in the response and if it’s more than 1 you need to repeat for further pages of results, i.e.

https://example.com/wp-json/wp/v2/categories?per_page=100&page=2
https://example.com/wp-json/wp/v2/categories?per_page=100&page=3

etc. as appropriate.