2Returns information about a specific version of a val.
3
4To access private vals this requires a secret called valtownToken, set to your API Token. See more about [authentication](https://docs.val.town/api/authentication) to understand how to generate a token.
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=43";
2
3console.log(await fetchJSON("https://api.val.town/v1/vals/7f9019e4-dbf8-4ebe-b8cd-67730697624e/versions"));
2Returns information about each version of a specific val.
3
4To access private vals this requires a secret called valtownToken, set to your API Token. See more about [authentication](https://docs.val.town/api/authentication) to understand how to generate a token.
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=43";
2
3console.log(await fetchJSON("https://api.val.town/v1/vals/7f9019e4-dbf8-4ebe-b8cd-67730697624e"));
2Gets information about a specific val.
3
4To access private vals, pass your API token as a secret to the function. Read more about [authentication](https://docs.val.town/api/authentication) to understand how to generate a token and save it as a secret.
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=43";
2
3console.log(await fetchJSON("https://api.val.town/v1/users/a0bf3b31-15a5-4d5c-880e-4b1e22c9bc18/vals"));
3console.log(
4 await fetchJSON(
5 "https://api.val.town/v1/eval",
6 {
7 method: "POST",
9 search_by_date: true,
10 });
11 // for each post get the number of upvotes from the hackernews api using fetch
12 for (let post of posts) {
13 let res = await fetch(`https://hacker-news.firebaseio.com/v0/item/${post.objectID}.json`);
3console.log(
4 await fetchJSON(
5 "https://api.val.town/v1/eval",
6 {
7 method: "POST",
195 >
196 </meta>
197 <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.4.0/model-viewer.min.js">
198 </script>
199 </head>