Get Started
Introduction
This section covers key concepts, authentication strategies, and standard response codes needed to interact with the WordPress REST API effectively.
Base URL
The WordPress API adheres to REST principles and enforces HTTPS for all requests to ensure data security and integrity. HTTP requests are not supported.
All requests are made to the following base URL:
Important Notes:
- Always use
https://
for security - Replace
yoursite.com
with your actual website address - The
/wp/v2
part tells you which version of the API you’re using
Authentication
To use the API, you’ll need to include your API key with the request:
Using Headers
Response Codes
When you make a request, you’ll get back one of these codes:
Code | Meaning | What to Do |
---|---|---|
200 | All good! | Your request worked |
400 | Wrong information sent | Check your request details |
401 | Missing/expired API key | Get a new API key |
403 | Not allowed | Check your permissions |
404 | Not found | Check the URL |
429 | Too many requests | Wait and try again |
500 | Server problem | Contact support |
Making Your First Request
Here’s a simple example to get you started:
Best Practices
- Always use HTTPS
- Keep your API keys secret
- Handle errors in your code
- Cache responses when possible
- Use proper authentication headers
Testing Tools
You can test your API using:
- The OpenAPI page in your dashboard
- Postman
- cURL commands
- Browser dev tools
Need More Help?
- Check our detailed documentation
- Look at code examples
- Try our starter templates
- Contact support if you’re stuck
Remember: Start with simple requests and build up to more complex ones as you learn!