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/?q=api&page=837&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 10974 results for "api"(1322ms)

blobmain.tsx5 matches

@vladimyr•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { ValTownBlobError } from "https://esm.town/v/std/ValTownBlobError";
3import { ValTownBlobNotFoundError } from "https://esm.town/v/std/ValTownBlobNotFoundError";
82async function list(prefix?: string): Promise<{ key: string; size: number; lastModified: string }[]> {
83 let querystring = prefix ? `?prefix=${encodeURIComponent(prefix)}` : "";
84 const res = await fetch(`${API_URL}/v1/blob${querystring}`, {
85 headers: {
86 Authorization: `Bearer ${Deno.env.get("valtown")}`,
95
96async function delete_(key: string) {
97 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
98 method: "DELETE",
99 headers: {
108
109async function get(key: string) {
110 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
111 headers: {
112 Authorization: `Bearer ${Deno.env.get("valtown")}`,
127 value = value.body;
128 }
129 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
130 method: "POST",
131 headers: {

emeraldPigmain.tsx2 matches

@onurpolattimur•Updated 1 year ago
2
3const craftgate = new Craftgate.Client({
4 apiKey: "sandbox-YEhueLgomBjqsnvBlWVVuFsVhlvJlMHE",
5 secretKey: "sandbox-tBdcdKVGmGupzfaWcULcwDLMoglZZvTz",
6 baseUrl: "https://sandbox-api.craftgate.io",
7});
8

blobSetResponseBodyExampleREADME.md1 match

@stevekrouse•Updated 1 year ago
1# Set Blob Storage via fetch Response body
2
3Inspired by [Wes Bos's tweet](https://twitter.com/wesbos/status/1775558324454392064?t=Pnx8jDyfF7wVbZJp0QnNJw&s=19) about Bun's elegant Filesystem API.
4
5Migrated from folder: Archive/blobSetResponseBodyExample

fireworks_ai_proxymain.tsx3 matches

@taras•Updated 1 year ago
60
61 let body: string | ReadableStream<Uint8Array> | null = null;
62 // https://api.fireworks.ai/inference/v1/models
63 if (pathname == COMPLETION) {
64 const params = await req.clone().json();
74 body = req.body;
75 }
76 url.host = "api.fireworks.ai";
77 url.port = "443";
78 url.protocol = "https";
92 const response = await fetch(url.toString(), init);
93 const responseHeaders = new Headers(response.headers);
94 // Special handling for /api/v1/models
95 if (pathname == MODELS) {
96 // Clone the response to read it without consuming the original stream

vtApiExamplemain.tsx3 matches

@neverstew•Updated 1 year ago
1import vtApi from "https://esm.town/v/neverstew/vtApi";
2
3const res = await vtApi.GET("/v1/search/vals", {
4 params: { query: { query: "api" } },
5});
6const vals = res.data.data;

vtApiExampleREADME.md1 match

@neverstew•Updated 1 year ago
1Migrated from folder: vtapi/vtApiExample

updateVtApiTypesmain.tsx3 matches

@neverstew•Updated 1 year ago
1import { updateValByName } from "https://esm.town/v/nbbaier/updateValByName?v=14";
2import openapiTS from "npm:openapi-typescript";
3
4export default async () => {
5 const output = await openapiTS("https://www.val.town/docs/openapi.yaml");
6 await updateValByName({
7 token: Deno.env.get("valtown"),
8 name: "vtApiTypes",
9 code: output,
10 });

vtApiTypesREADME.md1 match

@neverstew•Updated 1 year ago
1Migrated from folder: vtapi/vtApiTypes

updateVtApiTypesREADME.md1 match

@neverstew•Updated 1 year ago
1Migrated from folder: vtapi/updateVtApiTypes

cors_proxyREADME.md1 match

@taras•Updated 1 year ago
1```
2curl 'https://taras-free_open_router.web.val.run/api/v1/chat/completions' \
3 -H 'accept: application/json' \
4 -H 'authorization: Bearer THIS_IS_OVERRIDEN_ON_SERVER' \

daily-advice-app1 file match

@dcm31•Updated 2 days ago
Random advice app using Advice Slip API

gptApiTemplate1 file match

@charmaine•Updated 3 days ago
apiv1
papimark21