API Key: Difference between revisions

From Zoo Wiki
Fixed up the page and added a list of properties found in API Key.
reword the words
 
(21 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The API Key is a unique relic unlocked by sending a POST request to a "secret" endpoint. It was the first relic added to have a unique unlock method other than through quests. You require 3 relics to unlock the cosmetic. API Key has a description of "Reveals cooldown, timestamps, and other hidden info on the online zoo API."
{{Relic infobox}}
'''API Key''' is a unique [[Relics|relic]] unlocked by sending a request to a "secret" endpoint.


== Use ==
==Obtaining==
Provides access to secretInfo on the Zoo API, which has multiple kinds of stats within it.
The player must have at least three other relics in order to obtain API Key.<ref name="3relics"/>


{| class="sortable wikitable mw-collapsible mw-collapsed"
API Key is obtained by sending a [[wikipedia:POST request|POST request]] to the following endpoint: <code>https://gdcolon.com/zoo/api/zooKey</code>. This can be done using a desktop browser's [[wikipedia:Web development tools|developer tools]]. The request body must contain a [[wikipedia:JSON|JSON]] object, with the player's Discord ID as an <code>id</code> parameter. The player must also provide their [[wikipedia:session token|session token]], either as a [[wikipedia:HTTP cookie|cookie]] or as a <code>Token</code> [[wikipedia:HTTP header|header]].
|+ secretInfo
 
! Property Name
The server responds with an error, asking for an additional, randomly-selected password (e.g. public IP address / last 3 digits of your token) in the response body. The random selection changes per player. When resending the request with the password included, the API Key is granted.
! Information
 
Below is a working Python example:
 
<syntaxhighlight lang="python" line="">
import requests
url = "https://gdcolon.com/zoo/api/zooKey" #endpoint
headers = {"Content-Type": "application/json", "Accept": "application/json", "Token": ""} #request headers, insert authentication token into the Token header
 
#id refers to your Discord User ID
#password can be a few things (usually it's your public IP address/last 3 digits of your token). Leave blank at first and see the response to know which password it wants
params = {"id": "", "password": ""}
response = requests.post(url, headers=headers, json=params)
print(response.status_code)
print(response.text)
</syntaxhighlight>
 
The authentication token is obtained by
 
1. Logging into gdcolon.com/zoo
 
2. Going into the Application tab in the Developer Tools
 
3. Finding https://gdcolon.com under 'Cookies', which is located in 'Storage'.
 
4. Find the Cookie Value for 'zoo', which is the authentication token.
 
Here's a website that allows you to run python code. https://reqbin.com/code/python
 
===Troubleshooting===
'''If you encounter an error while running the code via the aforementioned website, follow these steps:'''
 
# Install Python
# Save your code in a Python (.py) file, you can use Python itself, Notepad, Visual Studio, anything you want. Save it in your user folder under an easy name (e.g. zoo.py)
# Open CMD (Win+R -> cmd), If you are on MacOS open Terminal from the Launchpad. If you are on Linux you know how to open the terminal already...
# Run the following command: python <span style="color: #666666">[name of the file with the code you saved]</span>
# If you did everything correctly, you should now have the API Key relic!
 
'''If python says the "requests" library is not installed, run this command in your terminal:'''<syntaxhighlight lang="batch">
python -m pip install requests
</syntaxhighlight>
 
==Effects==
{{Description}}
The player's profile on the [[Zoo API]] gains a <code>secretInfo</code> field with the following data:
 
{| class="wikitable sortable mw-collapsible mw-collapsed"
|+
!Key
!Explanation
!Data type
|-
|rowspan=2|<code>sort</code>
|rowspan=2|How the player's animals are sorted
|<code>0</code>: Sorted by amount
|-
|<code>1</code>: Sorted by name
|-
|<code>color</code>
|Zoo color
|Decimal number representing a [[wikipedia:hex triplet|hex triplet]]
|-
|<code>promise</code>
|Things guaranteed for the next rescue
|
{| class="wikitable sortable mw-collapsible"
|+
!Key
!Explanation
!Data type
|-
|<code>pair</code>
|Whether a pair is guaranteed
|Boolean
|-
|rowspan=8|<code>type</code>
|rowspan=8|The guaranteed [[animal type]]
|<code>arctic</code>: Arctic animal
|-
|<code>bird</code>: Bird
|-
|-
| sort
|<code>bug</code>: Bug
| Shows the sorting method in /animals. 0 being Name and 1 being Amount.
|-
|-
| color
|<code>farm</code>: Farm animal
| Shows the color of the zoo in a decimal number.
|-
|-
| promise
|<code>favorite</code>: Leader's favorite animal
| Shows what is promised on the next rescue. There can be multiple kinds of promises
|-
{| class="wikitable"
|<code>jungle</code>: Jungle animal
! Promise
|-
! Information
|<code>pet</code>: Pet
|-
|<code>water</code>: Aquatic animal
|-
|<code>animal</code>
|The guaranteed animal
|Internal name of the animal (equivalent to the shortcode of its emoji)
|-
|-
| type
|<code>debuffImmunity</code>
| Promises a specific type of animal on the next rescue.
|Cooldown raises will be divided by this number
|Integer
|-
|-
| pair
|<code>buffBoost</code>
| Promises a pair on the next rescue.
|Cooldown reductions will be multiplied by this number
|Integer
|-
|-
| animal
|<code>luckyRelics
| Promises a specific animal on the next rescue.
|Whether the best outcome is guaranteed for luck-based effects
|Boolean
|}
|}
|-
|-
| questEnd
|<code>questEnd</code>
| Shows the exact unix timestamp of when the quest ends.
|When the current [[quest]] ends
|[[wikipedia:Unix timestamp|Unix timestamp]]
|-
|<code>curseEnd</code>
|When the player's [[curse]] ends
|Unix timestamp
|-
|<code>mechanicEnd</code>
|When the current [[mechanic]] upgrade finishes
|Unix timestamp
|-
|<code>questBoosts</code>
|Bonuses for the current quest
|
{| class="wikitable sortable mw-collapsible"
|+
!Key
!Explanation
!Data type
|-
|<code>rareCurse</code>
|Whether [[Safety Pin]] was used
|Boolean
|-
|-
| questBoosts
|<code>extraRewards</code>
| Shows all boosts applied to the next quest.
|Number of extra rewards guaranteed by [[Telescope]]
|Integer
|-
|-
| curseEnd
|<code>length</code>
| Shows the exact unix timestamp of when the curse ends.
|Length increase
|Number of hours
|}
|-
|-
| mechanicEnd
|<code>shop</code>
| Shows the exact unix timestamp of when the mechanic finishes.
|Shop info
|
{| class="wikitable sortable mw-collapsible
|+
!Key
!Explanation
!Data type
|-
|-
| shop
|<code>credits</code>
| Shows multiple statistics about the shop
|Shop credits
{| class="wikitable"
|Integer
! Property Name
! Information
|-
|-
| credits
|rowspan=2|<code>maxCredits</code>
| The amount of shop purchases remaining.
|rowspan=2|Maximum credits
|<code>6</code> if [[Sack]] is equipped
|-
|-
| nextCredit
|<code>4</code> otherwise
| Shows the exact unix timestamp of when you get another credit.
|-
|-
| maxCredits
|<code>nextCredit</code>
| Shows the maximum amount of shop purchases that you can get at maximum.
|When the next credit will be given
|Unix timestamp
|-
|-
| lastPurchase
|<code>lastPurchase
| Shows the exact unix timestamp of your last purchase in the shop.
|Time of last purchase
|Unix timestamp
|}
|}
|-
|-
| cooldowns
|<code>cooldowns</code>
| Shows the unix timestamp of when all of your current cooldowns expire.
|Most time-based cooldowns
{| class="wikitable"
|
! Cooldowns
{| class="wikitable sortable mw-collapsible"
! Information
|+
!Key
!Explanation
!Data type
|-
|<code>rescue</code>
|Rescue cooldown
|rowspan=7|Unix timestamp
|-
|-
| rescue
|<code>relic</code>
| The exact unix timestamp of when you can rescue.
|Relic cooldown
|-
|-
| relic
|<code>leader</code>
| The exact unix timestamp of when you can switch relics.
|Leader cooldown
|-
|-
| leader
|<code>cardPull</code>
| The exact unix timestamp of when you can switch leaders.
|{{cmd|pull}} cooldown
|-
|-
| profile
|<code>pet</code>
| The exact unix timestamp of when you can switch or create profiles.
|{{cmd|pet}} cooldown
|-
|-
| cardPull
|<code>fishy</code>
| The exact unix timestamp of when you can pull a card.
|{{cmd|fishy}} cooldown
|-
|-
| pet
|<code>sisyphus</code>
| The exact unix timestamp of when you can pet roboturt.
|{{cmd|sisyphus}} cooldown
|-
|-
| fishy
|rowspan=2|<code>profile</code>
| The exact unix timestamp of when you can fish with the $ fishy command.
|rowspan=2|Profile cooldown
|<code>null</code> if player only has one profile
|-
|-
| sisyphus
|Unix timestamp otherwise
| The exact unix timestamp of when you can roll a boulder with the $ sisyphus command.
|}
|}
|-
|-
| terminal
|<code>terminal</code>
| Shows different information about the terminal.
|[[Terminal]] data
{| class="wikitable"
|
! Property Name
{| class="wikitable sortable mw-collapsible"
! Information
|+
!Key
!Explanation
!Data type
|-
|-
| directory
|<code>directory</code>
| Shows the current directory of the user.
|Current directory
|String
|-
|-
| commands
|<code>commands</code>
| Shows every command that the user has discovered. The current discoverable commands are "adminunlock", "dirwarp", "nick", "repaircmd", "give", "inventory", "pull", "show", "fuse", "fusions", "nfbs", "tokenshop", "unfuse", "wanted", "countxp", "button", "cowsay", "egg", "node", "pet", "pray", "sisyphus", "testconnection", "vim", "yes", "8ball", "dunsparce", "penguin", "percent", "ping", "random", "complete", "defer", "fishy", "fullzoo", "garden", "loop", "murphypoints", "nomnomnom", "pride", "todo", "zoo", "cd", "echo",  "help", "ls", "neofetch"
|Commands listed in {{cmd|help}}
|Array
|-
|-
| nextFusion
|<code>nextFusion</code>
| Shows how many rescues remain until you can fuse again.
|{{cmd|fuse}} cooldown
|Number of rescues until {{cmd|fuse}} can be used (<code>0</code> if no cooldown)
|}
|}
|-
|-
| garden
|<code>garden</code>
| Shows different information about the garden.
|[[Garden]] data
{| class="wikitable"
|
! Property Name
{| class="wikitable sortable mw-collapsible"
! Information
|+
!Key
!Explanation
!Data type
|-
|-
| nextPlant
|<code>nextPlant</code>
| Shows the exact unix timestamp until you can plant again.
|When the next seedling can be planted
|Unix timestamp
|-
|-
| watered
|rowspan=2|<code>watered</code>
| If the user has already watered a plant in their garden. true being that they have watered.
|rowspan=2|Whether the garden was watered
|<code>false</code>: A plant can be watered
|-
|-
| longestPlant
|<code>true</code>: Cannot water until rescuing again
| How long have you kept a plant alive for.
|-
|-
| sprinkler
|<code>longestPlant</code>
| What slot does the user have the sprinkler on.
|Longest lasting plant
|Milliseconds
|}
|}
|}
|}


== Obtaining ==
==History==
As mentioned before, this requires sending a POST request to a specified endpoint. If you do not know how to do this, there are many services online that can teach you within a few minutes. A sample code is provided below.
{| class="wikitable"
|+
!colspan=2|[[RoboTop]]
|-
|v93.22
|Added API Key.<ref>{{cite changelog|93.22|added a secret new relic, may or may not be hidden in the console of the zoo site|robotop=1}}</ref>
|+
!colspan=2|Zoo Bot
|-
|v1.0.1
|Now displays cooldowns for {{cmd|pull}} and {{cmd|pet}}.<ref>{{cite changelog|1.0.1|Added card and pet cooldowns to the API, if you have the right permissions}}</ref>
|-
|v1.3.1
|Now displays more info.<ref>{{cite changelog|1.3.1|Added more terminal related info to API Key}}</ref>
|-
|v1.4.5
|Now requires 3 other relics to unlock instead of just 1.<ref name="3relics">{{cite changelog|1.4.5|Tweaked a certain secret relic to require having 3 relics first (previously 1)}}</ref>
|}


API Key sample code (written with Python)
API Key was the first relic to have a unique unlock method other than through quests.
<syntaxhighlight lang="python" line>
import requests
url = "https://gdcolon.com/zoo/api/zooKey" #endpoint
headers = {"Content-Type": "application/json", "Accept": "application/json", "Token": ""} #request headers, insert authentication token into the Token header


#id refers to your Discord User ID
==References==
#password can be a few things (usually it's your public IP address/last 3 digits of your token). Leave blank at first to see the response
<references/>
params = {"id": "", "password": ""}
response = requests.post(url, headers=headers, json=params)
print(response.status_code)
print(response.text)
</syntaxhighlight>
 
The authentication token is obtained by
 
1. Logging into gdcolon.com/zoo
2. Going into the Application tab in the Developer Tools
3. Finding https://gdcolon.com under 'Cookies', which is located in 'Storage'.
4. Find the Cookie Value for 'zoo', which is the authentication token.


An online website for running Python code:
[[Category:Relics]]
https://reqbin.com/code/python
== Troubleshooting ==
'''If you encounter an error while running the code via the aforementioned website, follow these steps:'''
 
# Install Python
# Save your code in a Python (.py) file, you can use Python itself, Notepad, Visual Studio, anything you want. Save it in your user folder under an easy name (e.g. zoo.py)
# Open CMD (Win+R -> cmd), If you are on MacOS open Terminal from the Launchpad. If you are on Linux you know how to open the terminal already...
# Run the following command: python <span style="color: #666666">[name of the file with the code you saved]</span>
# If you did everything correctly, you should now have the API Key relic!
 
'''If python says the "requests" library is not installed, run this command in your terminal:'''<syntaxhighlight lang="batch">
python -m pip install requests
</syntaxhighlight>

Latest revision as of 23:20, 4 April 2026

API Key
“Nerd.”

API Key is a unique relic unlocked by sending a request to a "secret" endpoint.

Obtaining[edit | edit source]

The player must have at least three other relics in order to obtain API Key.[1]

API Key is obtained by sending a POST request to the following endpoint: https://gdcolon.com/zoo/api/zooKey. This can be done using a desktop browser's developer tools. The request body must contain a JSON object, with the player's Discord ID as an id parameter. The player must also provide their session token, either as a cookie or as a Token header.

The server responds with an error, asking for an additional, randomly-selected password (e.g. public IP address / last 3 digits of your token) in the response body. The random selection changes per player. When resending the request with the password included, the API Key is granted.

Below is a working Python example:

import requests
url = "https://gdcolon.com/zoo/api/zooKey" #endpoint
headers = {"Content-Type": "application/json", "Accept": "application/json", "Token": ""} #request headers, insert authentication token into the Token header

#id refers to your Discord User ID
#password can be a few things (usually it's your public IP address/last 3 digits of your token). Leave blank at first and see the response to know which password it wants
params = {"id": "", "password": ""}
 
response = requests.post(url, headers=headers, json=params)
print(response.status_code)
print(response.text)

The authentication token is obtained by

1. Logging into gdcolon.com/zoo

2. Going into the Application tab in the Developer Tools

3. Finding https://gdcolon.com under 'Cookies', which is located in 'Storage'.

4. Find the Cookie Value for 'zoo', which is the authentication token.

Here's a website that allows you to run python code. https://reqbin.com/code/python

Troubleshooting[edit | edit source]

If you encounter an error while running the code via the aforementioned website, follow these steps:

  1. Install Python
  2. Save your code in a Python (.py) file, you can use Python itself, Notepad, Visual Studio, anything you want. Save it in your user folder under an easy name (e.g. zoo.py)
  3. Open CMD (Win+R -> cmd), If you are on MacOS open Terminal from the Launchpad. If you are on Linux you know how to open the terminal already...
  4. Run the following command: python [name of the file with the code you saved]
  5. If you did everything correctly, you should now have the API Key relic!

If python says the "requests" library is not installed, run this command in your terminal:

python -m pip install requests

Effects[edit | edit source]

Reveals cooldown, timestamps, and other hidden info on the online zoo API.

— In-game description

The player's profile on the Zoo API gains a secretInfo field with the following data:

Key Explanation Data type
sort How the player's animals are sorted 0: Sorted by amount
1: Sorted by name
color Zoo color Decimal number representing a hex triplet
promise Things guaranteed for the next rescue
Key Explanation Data type
pair Whether a pair is guaranteed Boolean
type The guaranteed animal type arctic: Arctic animal
bird: Bird
bug: Bug
farm: Farm animal
favorite: Leader's favorite animal
jungle: Jungle animal
pet: Pet
water: Aquatic animal
animal The guaranteed animal Internal name of the animal (equivalent to the shortcode of its emoji)
debuffImmunity Cooldown raises will be divided by this number Integer
buffBoost Cooldown reductions will be multiplied by this number Integer
luckyRelics Whether the best outcome is guaranteed for luck-based effects Boolean
questEnd When the current quest ends Unix timestamp
curseEnd When the player's curse ends Unix timestamp
mechanicEnd When the current mechanic upgrade finishes Unix timestamp
questBoosts Bonuses for the current quest
Key Explanation Data type
rareCurse Whether Safety Pin was used Boolean
extraRewards Number of extra rewards guaranteed by Telescope Integer
length Length increase Number of hours
shop Shop info
Key Explanation Data type
credits Shop credits Integer
maxCredits Maximum credits 6 if Sack is equipped
4 otherwise
nextCredit When the next credit will be given Unix timestamp
lastPurchase Time of last purchase Unix timestamp
cooldowns Most time-based cooldowns
Key Explanation Data type
rescue Rescue cooldown Unix timestamp
relic Relic cooldown
leader Leader cooldown
cardPull $ pull cooldown
pet $ pet cooldown
fishy $ fishy cooldown
sisyphus $ sisyphus cooldown
profile Profile cooldown null if player only has one profile
Unix timestamp otherwise
terminal Terminal data
Key Explanation Data type
directory Current directory String
commands Commands listed in $ help Array
nextFusion $ fuse cooldown Number of rescues until $ fuse can be used (0 if no cooldown)
garden Garden data
Key Explanation Data type
nextPlant When the next seedling can be planted Unix timestamp
watered Whether the garden was watered false: A plant can be watered
true: Cannot water until rescuing again
longestPlant Longest lasting plant Milliseconds

History[edit | edit source]

RoboTop
v93.22 Added API Key.[2]
Zoo Bot
v1.0.1 Now displays cooldowns for $ pull and $ pet.[3]
v1.3.1 Now displays more info.[4]
v1.4.5 Now requires 3 other relics to unlock instead of just 1.[1]

API Key was the first relic to have a unique unlock method other than through quests.

References[edit | edit source]

  1. 1.0 1.1 Zoo changelog, v1.4.5 (released 8 September 2023):

    “Tweaked a certain secret relic to require having 3 relics first (previously 1)”

  2. RoboTop changelog, v93.22 (released 2 February 2022):

    “added a secret new relic, may or may not be hidden in the console of the zoo site”

  3. Zoo changelog, v1.0.1 (released 18 February 2023):

    “Added card and pet cooldowns to the API, if you have the right permissions”

  4. Zoo changelog, v1.3.1 (released 11 June 2023):

    “Added more terminal related info to API Key”