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/?q=api&page=978&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 11605 results for "api"(1911ms)

valTownApiExampleValmain.tsx2 matches

@tmcwUpdated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let valTownApiExampleVal = (async () => {
4 const response = await fetch(
5 `https://api.val.town/v1/alias/tmcw/valTownApiExampleVal`,
6 );
7 return await response.json();

evaluationFromValExamplemain.tsx1 match

@tmcwUpdated 1 year ago
2
3export let evaluationFromValExample = (async () => {
4 const response = await fetch(`https://api.val.town/v1/eval`, {
5 method: "post",
6 body: JSON.stringify({ code: "1 + 1" }),

untitled_qAbtMd3amain.tsx1 match

@stevekrouseUpdated 1 year ago
16 },
17 headers: {
18 "X-GitHub-Api-Version": "2022-11-28",
19 },
20 }));

uidmain.tsx1 match

@stevekrouseUpdated 1 year ago
4export let uid =
5 (await fetchJSON(
6 `https://api.val.town/v1/alias/${handle}`,
7 )).id;

myApimain.tsx1 match

@qingmangUpdated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

conversationalQAChainExmain.tsx3 matches

@jacoblee93Updated 1 year ago
15 );
16 const gpt35 = new ChatOpenAI({
17 openAIApiKey: process.env.OPENAI_API_KEY,
18 modelName: "gpt-3.5-turbo",
19 temperature: 0,
20 });
21 const gpt4 = new ChatOpenAI({
22 openAIApiKey: process.env.OPENAI_API_KEY,
23 modelName: "gpt-4",
24 temperature: 0,
28 [{ id: 2 }, { id: 1 }, { id: 3 }, { id: 4 }, { id: 5 }],
29 new OpenAIEmbeddings({
30 openAIApiKey: process.env.OPENAI_API_KEY,
31 }),
32 );

untitled_silverPinnipedmain.tsx1 match

@jacoblee93Updated 1 year ago
18 modelName: "gpt-4",
19 temperature: 0.2,
20 openAIApiKey: process.env.OPENAI_API_KEY,
21 });
22 // Output parser converts the chat message into a raw string. Also works with streaming.

githubFollowingmain.tsx1 match

@bdcravensUpdated 1 year ago
3// Github following
4export let githubFollowing = fetchJSON(
5 "https://api.github.com/users/stevekrouse/following"
6);

myApimain.tsx1 match

@davidarUpdated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

getGithubStarsForRepomain.tsx1 match

@joeyUpdated 1 year ago
7export const getGithubStarsForRepo = async (username: string, project: string) => {
8 const res = await fetchJSON(
9 `https://api.github.com/repos/${username}/${project}`
10 );
11 return parseInt(res.stargazers_count);

new-val-api-21 file match

@shouserUpdated 14 hours ago
This is an example of using the API to create a val.

gptApiTemplate2 file matches

@charmaineUpdated 1 day ago
papimark21
socialdata
Affordable & reliable alternative to Twitter API: ➡️ Access user profiles, tweets, followers & timeline data in real-time ➡️ Monitor profiles with nearly instant alerts for new tweets, follows & profile updates ➡️ Simple integration