Connecting a Lunar cycle API

Newbie to connecting API’s I can read html/css + js a little. Probs not a good start though willing to learn!

I’m hoping to connect a lunar cycle api to my website and would be amazing if I could get a step by step guide, only short and simple as i’ll learn along the way.

The idea would be to have a banner with the current lunar cycle running along or static at the top and as each users come in it will refresh with the latest and greatest - cool I know :wink:

Many thanks in advance!

Updated screen shots - getting 2 errors now

import - Parsing error: ‘import’ and ‘export’ may only appear at the top level
public/lunarcycleapi.js - Cannot find module ‘public/lunarcycleapi.js’ or its corresponding type declarations

I"m not sure if this is the issue or not, but in your first screenshot you have 2 OnReady() functions.

Every page should only ever have one of these as it is your page on ready and having multiple can cause unexpected behavior.

In addition, you will want to put any import statements outside of the onReady at the top of your page code

Finally. in your second screenshot I do not see where you are exporting anything to be able to be imported into your page code.

Another note that if your API key should be a secret, you will want to store that in the secrets manager (versus hardcoding). If you are just prototying, this is fine but I wanted to mention it in case you are not aware.

Let me know if this helps you to begin debugging the issue or if you need some more information or article links to get started

**Also, please use the code block instead of screenshots for sharing code here. it’s the </> button in the wyswyg