Skip to content

Instantly share code, notes, and snippets.

@camnwalter
Last active May 8, 2024 02:35
Show Gist options
  • Save camnwalter/c0156c68b1e2a21ec0b084c6f04b63f0 to your computer and use it in GitHub Desktop.
Save camnwalter/c0156c68b1e2a21ec0b084c6f04b63f0 to your computer and use it in GitHub Desktop.
API Keys After Hypixel's Changes

How to get a new API key after the Hypixel API changes

This key will last forever, and should be for personal use only. Providing a proxy like this to the public is strictly against Hypixel's API Policies.


  1. Go to the Hypixel Developer Dashboard, and log in using your forums account.
  2. Click "Create Development Key" to enable the "Create App" button in the top right.
  3. Create a new app. For this guide, we will make a personal app. Click the Personal API Key button, and fill out the form.
  • For the link field in the application, I just submitted my Cloudflare Workers URL generated in the next section of this guide. Just make sure the link is related to your project in some way.
  1. Once you submit the form, the key should be accepted shortly, just refresh the dashboard. Make sure to copy the api key Hypixel provides you for this application

Now that we have a personal api key, we can now begin the second part, which is to create the backend to protect the api key by keeping it private.

How to host a backend for free using Cloudflare Workers

  1. Now, go to Cloudflare Dashboard and sign up or sign in if you have an account already.
  2. Navigate to the sidebar and go to the Workers & Pages page.
    image
  3. Create a new application.
  4. Create a worker and name it something useful. By default it will have random words and numbers. Then, deploy.
  5. Now we need to edit the code, so click the edit code button. This will redirect you to a page to paste in the code linked here.
  6. Save and deploy. Now we can go back to the worker page, and edit its settings. We need to add the API key we got from the Hypixel Developer Dashboard earlier. image
  7. Click add variable. Name it API_KEY, and then paste in your api key into the value input. Make sure to encrypt the key.
  8. Save and deploy.

Now you've done it! You can now request the hypixel api in your programs by replacing the api.hypixel.net with your worker's url! This will keep your key private and safe, without worrying about it expiring.


Notes: If you ever need to regenerate your api key for any reason, go back to the Developer Dashboard and click Regenerate API Key under your application. Copy the new key and then paste it where you previously put the api key secret.

After that, you're all set. Your new api key will work after the worker gets redeployed.

@R1kabz
Copy link

R1kabz commented Jun 17, 2023

Hello, thanks for the tuto and the help you provide to us, but I have a question. In the Personal app form, what should we set in URL? Thanks again and sorry I'm not good in programs even if it seems easy.

@camnwalter
Copy link
Author

Hello, thanks for the tuto and the help you provide to us, but I have a question. In the Personal app form, what should we set in URL? Thanks again and sorry I'm not good in programs even if it seems easy.

I just provided the link for the cloudflare worker url. I might edit this to add that in.

@OlekUA
Copy link

OlekUA commented Jun 19, 2023

Hello, thanks for the tuto and the help you provide to us, but I have a question. In the Personal app form, what should we set in URL? Thanks again and sorry I'm not good in programs even if it seems easy.

I just provided the link for the cloudflare worker url. I might edit this to add that in.

Where did you provide it? In the personal app I put my workers url which is the https://hypixelapi.name.workers.dev/ one right?

@OlekUA
Copy link

OlekUA commented Jun 19, 2023

Is this all right?
image

@camnwalter
Copy link
Author

Where did you provide it? In the personal app I put my workers url which is the https://hypixelapi.name.workers.dev/ one right?

Yeah that's correct.

And try refreshing the page to see if it is approved.

@OlekUA
Copy link

OlekUA commented Jun 19, 2023

Where did you provide it? In the personal app I put my workers url which is the https://hypixelapi.name.workers.dev/ one right?

Yeah that's correct.

And try refreshing the page to see if it is approved.

Nope. Its been pending for almost an hour now, also how do I do the request thing? what do you mean by "replacing the api.hypixel.net with your worker's url" but I don't understand where the api.hypixel.net thing is, sorry about all the questions, it's just a little confusing since I'm not experience at all in this stuff.

@camnwalter
Copy link
Author

Like when you usually visit api.hypixel.net/skyblock/profile or whatever, just go to hypixelapi.name.workers.dev/skyblock/profile

@OlekUA
Copy link

OlekUA commented Jun 19, 2023

Like when you usually visit api.hypixel.net/skyblock/profile or whatever, just go to hypixelapi.name.workers.dev/skyblock/profile

I got rejected lol
image

@camnwalter
Copy link
Author

Well you should've said more than 4 words in the description 💀. Just have a few sentences on what you'll use it for.

@OlekUA
Copy link

OlekUA commented Jun 19, 2023

idk what to say, will they accept me saying i need it to use mods where api is needed for alot of features? or should i not mention that idrk what to say

@KarmaG20
Copy link

KarmaG20 commented Jul 5, 2023

Screenshot (109)1
Is this all right?

@camnwalter
Copy link
Author

Maybe? I would've put more details in the description though.

@KarmaG20
Copy link

KarmaG20 commented Jul 9, 2023 via email

@Lacikas
Copy link

Lacikas commented Jul 22, 2023

I need your help please! @camnwalter
I'm trying to do it multible times for the applications, but I got rejected multible times for no reason.
What should I put into,should I do this https://apikey.insert-email-here-b8c.workers.dev or https://hypixelapi.api-key-request.insert-email-here-b8c.workers.dev/ this? (btw that b8c is indeed a valid one just I only censure the email yk)
kép
When I open this ones link down here
kép
This is what it shows
kép
kép
kép

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment