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/$%7Burl%7D?q=api&page=50&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"(1530ms)

myApi1 file match

@smetzdev•Updated 1 year ago

myApi1 file match

@hovavo•Updated 1 year ago

generateValCodeAPI2 file matches

@andreterron•Updated 1 year ago

myApi1 file match

@broen•Updated 1 year ago

myApi1 file match

@ale•Updated 1 year ago

myApi1 file match

@enyo•Updated 1 year ago

myApi1 file match

@ooo_ooo_oooooh•Updated 1 year ago

myApi1 file match

@mik639•Updated 1 year ago

myApi1 file match

@hborska•Updated 1 year ago

emailAPI2 file matches

@stevekrouse•Updated 1 year ago

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

@shouser•Updated 2 hours 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 2 hours ago
1This is an example of using the API to create a file at the root.
apiv1
papimark21