Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/image-url.jpg?q=api&page=1481&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=api

Returns an array of strings in format "username" or "username/projectName"

Found 17838 results for "api"(1577ms)

test_explorer_routermain.tsx5 matches

@maxm•Updated 11 months ago
1/** @jsxImportSource npm:hono/jsx */
2
3import { api } from "https://esm.town/v/pomdtr/api";
4import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
5import { Island } from "https://esm.town/v/pomdtr/hono_island";
17const router = new Hono();
18
19const me = await api("/v1/me", { authenticated: true });
20const author = me.username;
21
57});
58
59router.post("/api/refresh", async () => {
60 const tests = await loadTests();
61
65async function loadTests(): Promise<TestType[]> {
66 const query = `https://esm.town/v/${author}/test_explorer`;
67 const { data: vals } = await api(`/v1/search/vals?query=${query}`, { authenticated: true });
68 const tests = {};
69 for (const val of vals) {
103}
104
105router.post("/api/run", async (c) => {
106 const body = await c.req.json();
107 try {

routermain.tsx4 matches

@maxm•Updated 11 months ago
1/** @jsxImportSource npm:hono/jsx */
2
3import { api } from "https://esm.town/v/pomdtr/api";
4import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
5import { Island } from "https://esm.town/v/pomdtr/hono_island";
56});
57
58router.post("/api/refresh", async () => {
59 const tests = await loadTests();
60
64async function loadTests(): Promise<TestType[]> {
65 const query = `https://esm.town/v/${author}/test_explorer`;
66 const { data: vals } = await api(`/v1/search/vals?query=${query}`, { authenticated: true });
67 const tests = {};
68 for (const val of vals) {
102}
103
104router.post("/api/run", async (c) => {
105 const body = await c.req.json();
106 try {

test_explorer_routermain.tsx4 matches

@pomdtr•Updated 11 months ago
1/** @jsxImportSource npm:hono/jsx */
2
3import { api } from "https://esm.town/v/pomdtr/api";
4import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
5import { Island } from "https://esm.town/v/pomdtr/hono_island";
56});
57
58router.post("/api/refresh", async () => {
59 const tests = await loadTests();
60
64async function loadTests(): Promise<TestType[]> {
65 const query = `https://esm.town/v/${author}/test_explorer`;
66 const { data: vals } = await api(`/v1/search/vals?query=${query}`, { authenticated: true });
67 const tests = {};
68 for (const val of vals) {
102}
103
104router.post("/api/run", async (c) => {
105 const body = await c.req.json();
106 try {

test_explorerREADME.md1 match

@maxm•Updated 11 months ago
33
34In order to define a test, the user need to import the Test class from `https://val.town/v/<account>/Test`.
35So we can use the api to search for vals containing the `https://val.town/v/<account>/Test` string to locate the vals containing tests.
36
37Next, we need to extract the tests from the val exports. We use `exported instanceof Test` to filter them (at some point we will probably use static analysis for this).

dubLinkMakermain.tsx3 matches

@mux•Updated 11 months ago
6
7// Make sure to set these environment variables
8const token = Deno.env.get("DUB_API_KEY");
9const dubWorkspaceId = Deno.env.get("DUB_WORKSPACE_ID");
10const signingSecret = Deno.env.get("SLACK_MUX_LINK_SIGNING_SECRET");
57 // If the destination is `list`, return a list of all the existing short links
58 if (destination === "list") {
59 const req = await fetch(`https://api.dub.co/links?workspaceId=${dubWorkspaceId}`, {
60 headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
61 });
84
85 try {
86 const resp = await fetch(`https://api.dub.co/links?workspaceId=${dubWorkspaceId}`, options).then(
87 response => response.json(),
88 );

nationstatesSentimentAIREADME.md2 matches

@bohaska•Updated 11 months ago
3Requires:
4- Huggingface token (HF_TOKEN) for the sentiment analysis of options. Generate a read-only token at [Huggingface](https://huggingface.co/settings/tokens) after making an account to use.
5- Email address (EMAIL) for user agent. Required as per [NationStates ToS](tionstates.net/pages/api.html#terms)
6- Autologin token (AUTOLOGIN) for logging into NationStates. See [NationStates API docs](https://www.nationstates.net/pages/api.html#authenticating) for more info.
7- Nation name (NATION_ID). Put your nation name, the one you use when you login to your account.
8

demoSDKREADME.md4 matches

@stevekrouse•Updated 11 months ago
1# Val Town REST API TypeScript SDK Demos
2
3This val demonstrates basic usage of the the Val Town JS/TS SDK.
5You can fork this val to your account to quickly try it out.
6
7Authentication is automatically set by the `VAL_TOWN_API_KEY` environment
8variable, which is automatically set within Val Town. You can control the
9API scopes of that key in your val's settings page.
10
11* [Learn more](https://docs.val.town/sdk/)
12* [Reference docs](https://github.com/val-town/sdk/blob/main/api.md)
13
14Migrated from folder: Archive/demoSDK

reactServermain.tsx2 matches

@iamseeley•Updated 11 months ago
13 <meta charset="UTF-8">
14 <meta name="viewport" content="width=device-width, initial-scale=1.0">
15 <link rel="preconnect" href="https://fonts.googleapis.com">
16 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
17 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet">
18 <title>${personalData.name} | Client-side React</title>
19 <style>

val_town_by_example_tocmain.tsx2 matches

@pomdtr•Updated 11 months ago
1import { api } from "https://esm.town/v/pomdtr/api";
2import { parseExample } from "https://esm.town/v/pomdtr/val_town_by_example_parse";
3import { blob } from "https://esm.town/v/std/blob";
106 if (typeof ref == "string") {
107 const [author, name] = ref.split("/");
108 const val = await api(`/v1/alias/${author}/${name}`);
109 const example = await parseExample(author, name);
110 group.items.push({

val_town_by_example_tocmain.tsx2 matches

@iamseeley•Updated 11 months ago
1import { api } from "https://esm.town/v/pomdtr/api";
2import { parseExample } from "https://esm.town/v/pomdtr/val_town_by_example_parse";
3import { blob } from "https://esm.town/v/std/blob";
106 if (typeof ref == "string") {
107 const [author, name] = ref.split("/");
108 const val = await api(`/v1/alias/${author}/${name}`);
109 const example = await parseExample(author, name);
110 group.items.push({

dailyQuoteAPI

@Souky•Updated 13 hours ago

HTTP

@Ncharity•Updated 15 hours ago
Daily Quote API
Kapil01
apiv1