> For the complete documentation index, see [llms.txt](https://cll-devrel.gitbook.io/bootcamp-2024/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cll-devrel.gitbook.io/bootcamp-2024/9.-off-chain-data-with-chainlink-functions/chainlink-functions-playground.md).

# Chainlink Functions Playground

Navigate to the [Chainlink Functions Playground](https://functions.chain.link/playground) and you will see this page with a simple example:

<figure><img src="/files/zTbySvSpZWxcvtmXKsUN" alt=""><figcaption><p>Chainlink Functions Playground</p></figcaption></figure>

### Inputs

1. Your Source code
2. Your Argument(s)
3. Your Secret, if any

When you are ready to run your code:

* &#x20;click the  “Run Code” button (#4) at the bottom left &#x20;
* your  "Output" (#5) will appear on the right hand side. In this traditional example, you get the `string` back "Hello World!"

***

### Star Wars Example

Back in the Chainlink Functions Playground, click the drop-down menu on the upper right called “Fill with example code” (#1) and  click the “Star Wars characters” example (#2):

<figure><img src="/files/6CkNaPxtq9Nv0KknDIxi" alt=""><figcaption></figcaption></figure>

The JavaScript source code will be loaded for your project.&#x20;

1. This is the first argument, which is the `characterId` you want to retrieve information about. `args` gets injected into your source code at runtime.  More on that later!
2. Then, a HTTP request is made to the URL: `https://swapi.info/api/people/${characterId}` using the `Functions` library that is also injected into the source code at run time.

<figure><img src="/files/EkfPaeMce7KBV4GWpVAy" alt=""><figcaption></figcaption></figure>

Let's assume that your first argument (which gets assigned to `characterId` ) is 1.  If you go to that link ([https://swapi.info/api/people/1/](https://swapi.info/api/people/$%7BcharacterId%7D/)) a you will see the following information:

<figure><img src="/files/ZqZ6zhPvxfDzSxNkPC8d" alt=""><figcaption><p>Luke Skywalker</p></figcaption></figure>

This has various information about the Star Wars character Luke Skywalker. You can change the argument `1` to `2` and so on for other Star Wars characters.

{% hint style="info" %}
Hint:`4` is Darth Vader!&#x20;
{% endhint %}

Now back at the Playground, pass your arguments to the source code using the text input boxes.  Put `1` as shown in the image (#1) and and  click the “Run Code” (#2) blue  button.

&#x20;You will see the “Console log”  and "Output" data on the right with all the information on Luke Skywalker:

<figure><img src="/files/NP27KogdOwDmWa2Zrh0D" alt=""><figcaption></figcaption></figure>

By utilizing the Chainlink Functions Playground, you verify your code to make sure it works before you put that into your contracts. Pretty neat, huh?


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://cll-devrel.gitbook.io/bootcamp-2024/9.-off-chain-data-with-chainlink-functions/chainlink-functions-playground.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
