What is an API?
An API is — in short — a set of dedicated URLs that return pure data responses, in most cases in JSON format — meaning the responses won’t contain the kind of presentational overhead that you would expect in a graphical user interface like a website. I took that great definition from this very understandable article. Please refer to it for more information!
Access the Blog API
You can access the API using the following base URL:
https://blog-api-production-2267.up.railway.app/
To interact with the blog API, append the specific endpoints listed above to the base URL.
How can I get my access token?
First, create an account by clicking on the menu in the top left corner and log in. Once you're logged in, you'll be able to access your profile and retrieve your access token.
Which routes are available?
Method | Endpoint | Response | Token Required |
---|---|---|---|
GET | /posts | Get all blog posts | No |
Get | /post/10 | Get a specific post | Yes - Regular user |
Patch | /posts/10 | Update a specific post | Yes - Admin only |
POST | /post | Create a new post | Yes - Admin only |
Delete | /delete/10 | Delete a specific post | Yes - Admin only |
May I use pagination
Yes, you can add pagination, sorting and filtering options to your API requests.
Pagination
Method | Example |
---|---|
GET | /posts?page=1&limit=10 (limit default is 10) |
GET | 1st page, 10 items: 2nd page, 10 items: 3rd page, 20 items: |
Search
method | Examples |
---|---|
GET | /search?query=javascript&category=all |
GET | /search?query=typescript&category=web |
GET | /search?query=react&category=mobile |
How to Contribute to This Project
This project is open-source ❤️, I we’d love for you to help make it even better. Whether you're fixing bugs, adding features, or improving documentation, your input is always welcome. You can start by visiting the GitHub repository to explore the code and get involved.
Don't hesitate to fork the project, submit issues, and create pull requests. I can't wait to see what you'll bring to the project!
This API powers this blog: https://victorlirablog.com.br