API problem

Website URL

https://xware.gt.tc

Error Message

Using APIs in my forum website.

Other Information

Hello so I had problem with my website and I read this article

And thought about can I use infinity free domain as a frontend and also connect the cloudflare domain and request the APIs from the cf domain?

Welcome to the InfinityFree community forum! Good to have you here.

  • Most people answering here are volunteers. They’re often the fastest source of help. Admin (the only staff member) checks in about once a day for issues on our end.
  • Volunteers can’t see your account or website. Share what you actually see, like error messages and what happens when you try something. That’s more useful than your theory of what’s wrong.
  • AI tools often get InfinityFree wrong. If a volunteer’s advice differs from what an AI told you, please try the volunteer’s suggestion first.
  • Solving an issue is a joint effort. Try the suggestions you get and report back what happened.

Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look.

It depends on where the API code would actually run, so which is it? Is the Cloudflare domain pointed at your InfinityFree account, or would the API be hosted somewhere else, such as another provider or a Cloudflare service?

If the Cloudflare domain just points at your InfinityFree hosting, it won’t help. The browser security check is part of the hosting, not the domain, so it covers every URL on the account and can’t be turned off for one path. The article says this directly:

The article describes what’s blocked: REST API requests from tools and scripts, and AJAX requests from other domains (CORS). It also says what keeps working: JavaScript calls to endpoints on the same domain, and your site’s own server-side code making requests to external services. The check only applies to requests coming in to an InfinityFree site, so an API hosted elsewhere wouldn’t be subject to it. The articles don’t describe that exact setup, though, so I can’t promise how it would behave.

The second article lists your options for API access: premium hosting, a different service for the API, or having your site make outbound requests.

The loophole has been closed