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=1278&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 13978 results for "api"(2033ms)

3
4export let untitled_scarletHoverfly = fetchJSON(
5 "https://api.val.town/v1/eval",
6 {
7 method: "POST",

testSemanticsmain.tsx5 matches

@stevekrouseUpdated 1 year ago
3export async function testSemantics({
4 stateName,
5 api,
6}: {
7 stateName: string;
8 api: string;
9}) {
10 const { data: last } = await fetchJSON(
11 `${api}/eval/${stateName}`
12 );
13 const now = Date.now();
14 await fetchJSON(`${api}/eval/${stateName} = ${now}`);
15 const { data: next } = await fetchJSON(
16 `${api}/eval/${stateName}`
17 );
18 if (next === now) return "❌ Unauthenticated can mutate state";

rateLimitmain.tsx1 match

@stevekrouseUpdated 1 year ago
3import { msDay } from "https://esm.town/v/stevekrouse/msDay";
4
5// simple rate limiter to ensure you don't get a surprise api bill
6// supports multiple keys, so you can rate limit various things
7// the default limit is 1000 but you can supply your own

valtownApiTypesImportTestmain.tsx4 matches

@stevekrouseUpdated 1 year ago
1export let valtownApiTypesImportTest = (async () => {
2 const openapi = await import("https://esm.sh/valtown-api-types@0.1.1");
3 console.log(Object.keys(openapi));
4})();
5// Forked from @nbbaier.valtownApiTypesImportTest

myApimain.tsx1 match

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

myApimain.tsx1 match

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

myApimain.tsx1 match

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

testApimain.tsx1 match

@claywayUpdated 1 year ago
1export async function testApi(request: Request): Promise<Response> {
2 if (request.method !== "POST") {
3 return Response.json({

myApimain.tsx1 match

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

githubEventsmain.tsx1 match

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

new-val-api-demo

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

groq-api2 file matches

@cameronpakUpdated 1 day ago
snartapi
mux
Your friendly, neighborhood video API.