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=1654&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 18154 results for "api"(6835ms)

githubFollowingmain.tsx1 match

@tmcw•Updated 1 year ago
5 throw new Error(`${fetchJSON.impl.toString()}`);
6 return fetchJSON(
7 "https://api.github.com/users/stevekrouse/following"
8 );
9})();

jsYAMLExamplemain.tsx1 match

@tmcw•Updated 1 year ago
6 // Fetch a YAML file
7 const yaml = await fetch(
8 "https://raw.githubusercontent.com/docker/engine/8955d8da8951695a98eb7e15bead19d402c6eb27/api/swagger.yaml",
9 ).then((r) => r.text());
10 // parse the fetched file
5 const response =
6 (await fetch(
7 "https://api.val.town/v1/run/politelyinvinciblepointer.handleForm",
8 {
9 method: "POST",

checkIfTwitterAPIIsDownmain.tsx10 matches

@stevekrouse•Updated 1 year ago
1let { twitterAPIDown } = await import("https://esm.town/v/stevekrouse/twitterAPIDown");
2import process from "node:process";
3import { msHour } from "https://esm.town/v/stevekrouse/msHour";
4import { twitterSearch } from "https://esm.town/v/stevekrouse/twitterSearch";
5
6// let's poll the elevated v2 twitter api
7// until it's down, and store the state in
8// @stevekrouse.twitterAPIDown ({ down: boolean, reason: string})
9export async function checkIfTwitterAPIIsDown() {
10 try {
11 // query for something we know will return results
16 });
17 if (results.length) {
18 // if we get results, the API is still up
19 twitterAPIDown = {
20 down: false,
21 reason: `search returned ${results.length} results at ${new Date()}`,
22 };
23 } else {
24 // no results = API down
25 twitterAPIDown = {
26 down: true,
27 reason: `search returned ${results.length} results at ${new Date()}`,
29 }
30 } catch (e) {
31 // if there's an error, the API is also likely down
32 twitterAPIDown = {
33 down: false,
34 reason: `search errored ${e.message} at ${new Date()}`,

myApimain.tsx1 match

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

textToImageDallemain.tsx1 match

@stevekrouse•Updated 1 year ago
17 };
18 } = await fetchJSON(
19 "https://api.openai.com/v1/images/generations",
20 {
21 method: "POST",

untitled_chocolateSquidmain.tsx1 match

@jacoblee93•Updated 1 year ago
18 const chat = new ChatOpenAI({
19 temperature: 0,
20 openAIApiKey: process.env.OPENAI_API_KEY,
21 });
22 const chain = new LLMChain({

myApimain.tsx1 match

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

myApiDeletemain.tsx1 match

@acmu•Updated 1 year ago
2let { nameList } = await import("https://esm.town/v/acmu/nameList");
3
4export async function myApiDelete(name) {
5 if (Array.isArray(nameList)) {
6 nameList = nameList.filter((i) => i !== name);

arenaHelpersmain.tsx1 match

@korede•Updated 1 year ago
21 }
22 const urlParams = new URLSearchParams(params);
23 const url = `https://api.are.na/v2/users/${userId}/channels` +
24 (Object.keys(params).length ? `?${urlParams.toString()}` : "");
25 const response = await fetch(url, {

xxxclearinghouse_validator

@toowired•Updated 5 hours ago
Request validator for clearance API

Apiify11 file matches

@wolf•Updated 23 hours ago
Kapil01
apiv1