CRUD stands for Create, Read, Update, and Delete — the four basic operations used when interacting with data in any application.
With JavaScript and the Fetch API, you can communicate with a backend server (like the Platzi Fake Store API) to perform CRUD operations on product data.
- Read You can retrieve all products or a specific product by ID or slug:
All Products: GET https://api.escuelajs.co/api/v1/products
By ID: GET https://api.escuelajs.co/api/v1/products/4
By Slug: GET https://api.escuelajs.co/api/v1/products/slug/handmade-fresh-table
- Create To add a new product:
POST https://api.escuelajs.co/api/v1/products
Include product data in the request body as JSON.
- Update To modify an existing product:
PUT https://api.escuelajs.co/api/v1/products/1
Pass updated fields in the request body.
- Delete To remove a product:
DELETE https://api.escuelajs.co/api/v1/products/1
📘 You can read the full guide attached above for a detailed explanation in English with full code examples.
Here
Top comments (4)
pretty cool walk-through tbh, makes me wanna build something simple again - you ever run into headaches hooking up apis like this or does it just click after a while?
Oh for sure, had my fair share of headaches 😅 but yeah, after a while it kinda just starts to click. Every new API teaches you something.
pretty cool, honestly seeing it broken down like this always makes me want to try building stuff myself
you ever mess up a big data call and have to untangle everything afterwards?
Oh definitely 😅 messed up more than a few — sometimes one wrong assumption and you’re digging through layers of nested data trying to figure out what broke. But that’s how you really learn, I guess.
Some comments may only be visible to logged-in visitors. Sign in to view all comments. Some comments have been hidden by the post's author - find out more