# Find your WordPress API https://www.sanity.io/learn/course/migrating-content-from-wordpress-to-sanity/first-steps.md Find and test your WordPress installations built in REST API to retrieve content. The first step is assessing how you export content from your WordPress project. There are several ways to extract content from WordPress. In this course, you'll target the REST API. ## Accessing the WordPress REST API The WordPress REST API is a core feature of WordPress and a predictable way to query public and private content directly from the source. 1. See the [WordPress REST API handbook documentation](https://developer.wordpress.org/rest-api/). If you prefer to use the [XML export](https://wordpress.com/support/export/) tooling or [WPGraphQL](https://www.wpgraphql.com/), you must modify the logic of the scripts written in this course. Before proceeding, you must ensure that your current install allows access to the REST API. You may have a security plugin or other configuration that blocks access. A simple way to get around this is to run WordPress locally with a copy of your production database. Typically, you can visit the REST API at the following route: ```text https:///wp-json/wp/v2 ``` You should see a JSON response in your web browser, with the available routes to query content from: ![Missing alt text](https://cdn.sanity.io/images/3do82whm/next/f3639956069e8047ab26aeab9741664c66d4999f-2144x1388.png) 1. The above is viewed in a Chromium-powered web browser with the [JSON Formatter extension](https://chromewebstore.google.com/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa?hl=en&pli=1) installed To compare, some publicly available blogs which have an open REST API include: ```text https://ma.tt/wp-json/wp/v2 https://blog.ted.com/wp-json/wp/v2 https://finland.fi/wp-json/wp/v2 https://www.nasa.gov/wp-json/wp/v2 ``` 1. Find your WordPress installation's REST API URL Once you've confirmed your WordPress installation has an open API URL, you can get started. ### A note on Multisite URLs For WordPress Multisite / Network setups, you will need to target a specific site by adding its name to the URL. ```text https:////wp-json/wp/v2 ``` ### Testing your REST API URL During the following lessons, you'll write a script that queries the URL for each content type (posts, pages, etc) individually. From your terminal, you can see how many documents of each type can be found, by using `curl` and returning the headers. Run the following in the terminal, with your REST API URL: ```sh:Terminal curl -sI https:///wp-json/wp/v2/posts | grep -i '^x-wp' ``` You should receive a response like this, where you can see the total number of publicly available posts ```sh:Terminal x-wp-total: 21492 x-wp-totalpages: 2150 ``` * `x-wp-total` is the number of publicly queryable posts * `x-wp-totalpages` is the number of paginated responses you can query through to retrieve them individually, using whatever `posts_per_page` setting is the default for your site—or added to your query. The script you write in this course will query for 100. Now you've confirmed the URL works, and you can see how many publicly available posts can be queried from your WordPress installation, let's prepare a new home for your content.