# Example Implementations

{% hint style="info" %}
Like any captcha, it is normal to have some unolvable captchas sometimes, just load and solve a new one
{% endhint %}

{% tabs %}
{% tab title="v3" %}

```python
from requests import get, post
from time import time

API_KEY = "TAKION_API_XXXX"

def load_geetestv3(challenge_type: str):
    if challenge_type.lower() not in ["slide", "icon"]:
        print(f"Invalid challenge '{challenge_type}")
        return False
    
    url = f'https://www.geetest.com/demo/gt/register-en{challenge_type.capitalize()}-official?t={time() * 1000}'
    return get(url).json()

def solve_geetest(challange, gt):
    params = {
        "challenge": challange,
        "gt": gt,
        "api_key": API_KEY
    }
    url = "https://geetest.takionapi.tech/v3"

    return get(url, params=params).json()

if __name__ == '__main__':
    for challenge in ["slide", "icon"]:
        print(f"Loading {challenge} challenge...")
        challenge_details = load_geetestv3(challenge)
        print(f"Solving... {challenge_details['challenge']}")
        response = solve_geetest(challenge_details['challenge'], challenge_details['gt'])
        print(f"Response: {response}")
```

{% endtab %}

{% tab title="v4" %}

```python

from requests import get, post
from time import time

API_KEY = "TAKION_API_XXXX"

def solve_geetest(captcha_id, kind):
    params = {
        "captcha_id": captcha_id,
        "kind": kind,
        "api_key": API_KEY
    }
    url = "https://geetest.takionapi.tech/v4"

    return get(url, params=params).json()

if __name__ == '__main__':
    for challenge in ["slide", "ai"]:
        print(f"Solving {challenge} challenge...")
        response = solve_geetest(
            "fcd636b4514bf7ac4143922550b3008b",
            challenge
        )
        print(f"Response: {response}")
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.takionapi.tech/geetest/examples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
