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=48&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 11580 results for "api"(999ms)

myApi1 file match

@sharetru•Updated 1 year ago

myApi1 file match

@frankysnow•Updated 1 year ago

myApi1 file match

@steffen•Updated 1 year ago

myApi1 file match

@willosbourne•Updated 1 year ago

myApi1 file match

@riodpp•Updated 1 year ago

myApi1 file match

@markng•Updated 1 year ago

myApi1 file match

@sa1L•Updated 1 year ago

myApi1 file match

@max•Updated 1 year ago

myApi1 file match

@phl•Updated 1 year ago

myApi1 file match

@daveliepmann•Updated 1 year ago

v2-vals-post-request-examplemain.tsx7 matches

@shouser•Updated 28 mins ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import ValTown from "npm:@valtown/sdk";
28);
29
30// Example of using the API to create a new val with a single file
31// First create the val
32const valResponse = await fetch(
33 `${API_URL}/v2/vals`,
34 {
35 method: "POST",
36 body: JSON.stringify({
37 name: "new-val-api",
38 privacy: "public",
39 description: "This is an example of using the API to create a val.",
40 }),
41 headers: {
53const val = await valResponse.json();
54const fileResponse = await fetch(
55 `${API_URL}/v2/vals/${val.id}/files?path=main.tsx`,
56 {
57 method: "POST",
58 body: JSON.stringify({
59 content: "This is an example of using the API to create a file at the root.",
60 type: "file",
61 }),

new-val-api-2main.tsx1 match

@shouser•Updated 30 mins ago
1This is an example of using the API to create a file at the root.
api
aquapi