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/$%7Bsuccess?q=api&page=1043&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 11733 results for "api"(3246ms)

myApimain.tsx1 match

@ooo_ooo_ooooohUpdated 1 year ago
1export function myApi(question, answer) {
2 return `${question}? - ${answer}`;
3}

myApimain.tsx1 match

@mik639Updated 1 year ago
1import { greet } from "https://esm.town/v/mik639/greet";
2
3export function myApi(name) {
4 console.email(greet(name), "Test email");
5}

myApimain.tsx1 match

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

getAaveV2Liquidationsmain.tsx1 match

@alexandreUpdated 1 year ago
8 );
9 const result = await fetch(
10 "https://gateway.thegraph.com/api/6e951d2948be69a241891fb15ec9cefb/deployments/id/QmYN4ofRb5CUg1WdpLhhNTVCuiiAt29hBKGjTnnxYh9zYt",
11 {
12 "headers": {
5export let hasValTownStyleGuideUpdated = async (since: Date) => {
6 let commits = await fetchJSON(
7 "https://api.github.com/repos/val-town/val.town/commits?path=/src/style.tsx&since=" +
8 since.toISOString(),
9 {

dsnyEventsFeedmain.tsx1 match

@tmcwUpdated 1 year ago
4 const ics = await import("npm:ics");
5 const events = await fetch(
6 "https://a827-donatenyc.nyc.gov/DSNYApi/api/Events/GetAllByBorough?borough=",
7 )
8 .then((r) => r.json());

chessTimemain.tsx1 match

@tmcwUpdated 1 year ago
3export let chessTime = (async () => {
4 const { secondsToHours } = await import("npm:date-fns");
5 const stats = await fetch("https://lichess.org/api/user/tmcw").then((r) =>
6 r.json()
7 );

unserializeableLogExmain.tsx3 matches

@stevekrouseUpdated 1 year ago
2
3export let unserializeableLogEx = (async () => {
4 const { Configuration, OpenAIApi } = await import("npm:openai");
5 const configuration = new Configuration({
6 apiKey: process.env.openai,
7 });
8 const openai = new OpenAIApi(configuration);
9 console.log(openai);
10})();
1import { testMutateSemantics } from "https://esm.town/v/stevekrouse/testMutateSemantics";
2
3export const unauthenticatedCantMutateThroughBadSetter = (api) =>
4 testMutateSemantics({
5 stateName: "@stevekrouse.testState",
6 api,
7 mutateExpected: false,
8 mutator: (now) => `@steveVT.mutateTestStateBad(${now})`,
1import { testMutateSemantics } from "https://esm.town/v/stevekrouse/testMutateSemantics";
2
3export const unauthenticatedCanMutateThroughSetter = (api) =>
4 testMutateSemantics({
5 stateName: "@stevekrouse.testState",
6 api,
7 mutateExpected: true,
8 mutator: (now) => `@stevekrouse.mutateTestState(${now})`,

gpt-image-test

@CaptainJackUpdated 10 hours ago
测试 gpt image 的不同 api 能否满足图片生成要求

new-val-api-21 file match

@shouserUpdated 1 day ago
This is an example of using the API to create a val.
apiv1
papimark21