Skip to main content

Making your first Lighthouse API call

Where the API lives, how to authenticate with your key, how paging works, and how to keep the key safe.

This page assumes you already have an API key. If you do not, create one first from your Lighthouse account under Tools, then API keys.

Where the API lives

The base address is https://lighthouse.cantonloop.com/api. Every endpoint hangs off it, so a call to the parties endpoint is that address followed by /parties.

The interactive reference is at https://lighthouse.cantonloop.com/swagger/index.html. It lists every endpoint with its parameters and response shapes, and it is the place to check when something here is not detailed enough.

Authenticating

Send your key in the Authorization header of every request, in the form Bearer followed by a space and then the key itself.

There is nothing else to sign, no session to keep alive and no token to refresh. The key on its own is enough.

If you call an endpoint without a key, you are treated as anonymous traffic. Some endpoints allow that at a much lower limit, and the paid endpoints do not allow it at all.

What read-only means

API keys are read-only. They let you read network data. They cannot move funds, sign anything, change your account or act on your wallet in any way.

That is deliberate, and it is worth knowing when you decide where to store the key: a leaked key exposes your quota, not your assets.

Trying it without writing code

Open the reference page, select Authorize, paste your key, and every endpoint becomes callable from the browser.

This is the fastest way to see what a response actually looks like before you build anything around it, and it saves the usual round of guessing at field names.

Paging through results

List endpoints return a page at a time rather than everything at once.

Parameter

What it does

limit

How many records to return in one page. Most list endpoints default to 20 and cap at 100.

cursor

Where to continue from. You take it from the page you just received rather than counting pages yourself.

direction

Whether to walk forwards or backwards from the cursor. Forwards is the default.

Some endpoints use a more specific anchor instead, such as a record id or a round number. The reference page shows which parameters each endpoint accepts.

Raising limit to its maximum is usually better than making many small calls, because each call counts against your daily quota regardless of how many records it returns.

Keeping the key safe

The key is shown once, at the moment you create it, and cannot be retrieved afterwards. Copy it straight into your secret store.

Name each key after the service that uses it, so that revoking one later does not mean guessing which of your systems will stop working.

Keep keys out of front-end code, public repositories, screenshots and support messages. If a key has been exposed, revoke it from the same page and create a new one. Revocation takes effect immediately.

You can hold several active keys at once, which is what makes a clean rotation possible: create the new one, move your services across, then revoke the old one.

If a call is not working

A rejected request usually says why. The meaning of each status code, and what to do about a rate limit, is covered in the limits and errors article below.

If you are still stuck, message us from this page with the endpoint you called, the parameters you sent, the status code you got back and roughly when. Please do not send us the key itself.

Related

Did this answer your question?