How do I set up a read only API for my forum page

What are you trying to do with the API?

Maybe see Reverse engineer the Discourse API

When you create an API key key you can specify the user and a set of things that key can access, so maybe you can select just the ones that give read access to . . . whatever you’re trying to do?