The endpoint I want to protect is public access, it does not require user authentication.
A public API is public - a CSRF token is not the solution; properly implementing API token authentication is your best approach
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello guys, I created an api, but a competitor website steals the content of my api.
How can I protect the links so they can't access from another server?
The endpoint I want to protect is public access, it does not require user authentication.
I have tried making the endpoint POST so that the CSRF protection can protect the endpoint, but the site that steals my content manages without problem to overcome the protection of the CSRF token (looking for tutorials on how to hack the CSRF token I saw that it is not very complicated).
If I use some kind of token or bearer and it is sent by headers it is useless because it is easy to identify and reuse the data to make requests and steal my content.
Any ideas/suggestions on how to protect my routes?
Please or to participate in this conversation.