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/$%7Bart_info.art.src%7D?q=api&page=979&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 11824 results for "api"(1475ms)

myApimain.tsx1 match

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

queryTwittermain.tsx1 match

@ted•Updated 1 year ago
3export let queryTwitter = (query: string) => {
4 return twitterRequest(
5 `https://api.twitter.com/2/tweets/search/recent?query=${query}&tweet.fields=created_at`
6 );
7};

nameNationalitymain.tsx1 match

@madmod•Updated 1 year ago
3// Predict the nationality of a name
4export let nameNationality = fetchJSON(
5 "https://api.nationalize.io/?name=michael"
6);

createIssuemain.tsx1 match

@andy_blum•Updated 1 year ago
31 ],
32 headers: {
33 "X-GitHub-Api-Version": "2022-11-28",
34 },
35 });

githubEventsmain.tsx1 match

@sdan•Updated 1 year ago
3// GitHub events
4export let githubEvents = fetchJSON(
5 "https://api.github.com/users/stevekrouse/events",
6);

githubUsermain.tsx1 match

@stevekrouse•Updated 1 year ago
3// Github profile
4export let githubUser = fetchJSON(
5 "https://api.github.com/users/stevekrouse"
6);

eval_main.tsx1 match

@stevekrouse•Updated 1 year ago
2
3export let eval_ = (code, args?) =>
4 fetchJSON("https://api.val.town/v1/eval", {
5 method: "POST",
6 body: JSON.stringify({

rimeAPIExmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { runVal } from "https://esm.town/v/std/runVal";
2
3export const rimeAPIEx = await runVal("stevekrouse.rime", {
4 text: "hello friend",
5 speaker: "young_female_latina-4",

measureValTownE2emain.tsx2 matches

@stevekrouse•Updated 1 year ago
7 for (let i = 0; i < count; i++) {
8 let start = Date.now();
9 await fetch("https://api.val.town/eval/(()=%3E1+1)()");
10 evalTimes.push(Date.now() - start);
11 }
22 for (let i = 0; i < count; i++) {
23 let start = Date.now();
24 await fetch("https://api.val.town/eval/@healeycodes.addOnes()");
25 userFuncTimes.push(Date.now() - start);
26 }

bskySocialExmain.tsx2 matches

@stevekrouse•Updated 1 year ago
2
3export let bskySocialEx = (async () => {
4 const { default: api } = await import("npm:@atproto/api");
5 const service = "https://bsky.social";
6 const agent = await new api.BskyAgent({ service });
7 await agent.login({
8 identifier: process.env.blueskyEmail,

social_data_api_project3 file matches

@tsuchi_ya•Updated 3 hours ago

new-val-api-21 file match

@shouser•Updated 22 hours ago
This is an example of using the API to create a val.
apiv1
papimark21