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.
- Go to the Hypixel Developer Dashboard, and log in using your forums account.
- Click "Create Development Key" to enable the "Create App" button in the top right.
- 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.
- 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.
- Now, go to Cloudflare Dashboard and sign up or sign in if you have an account already.
- Navigate to the sidebar and go to the Workers & Pages page.
- Create a new application.
- Create a worker and name it something useful. By default it will have random words and numbers. Then, deploy.
- 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.
- 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.
- Click add variable. Name it API_KEY, and then paste in your api key into the value input. Make sure to encrypt the key.
- 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.
Is this all right?
