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=985&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 12463 results for "api"(3459ms)

fetchNewPublicGitHubReposmain.tsx3 matches

@stevekrouse•Updated 1 year ago
7 const order = "desc";
8
9 const url = `https://api.github.com/search/repositories?q=${encodeURIComponent(query)}&sort=${sort}&order=${order}`;
10
11 const response = await fetch(url, {
12 headers: {
13 "Accept": "application/vnd.github.v3+json",
14 "User-Agent": "Deno-GitHub-Repo-Fetcher", // GitHub API requires a user-agent header
15 },
16 });
17
18 if (!response.ok) {
19 throw new Error(`GitHub API responded with status: ${response.status}`);
20 }
21

http_request_examplemain.tsx2 matches

@pomdtr•Updated 1 year ago
4 */
5
6// To make a request to a server, you use the `fetch` API.
7let resp = await fetch("https://example.com");
8
32 headers: {
33 "Content-Type": "application/json",
34 "X-API-Key": "foobar",
35 },
36 body,

setmain.tsx2 matches

@pomdtr•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import process from "node:process";
5export async function set(key: string, value: any) {
6 let resp = await fetch(
7 `${API_URL}/v1/vals`,
8 {
9 method: "PUT",

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 });

vapi-minutes-db2 file matches

@henrywilliams•Updated 6 hours ago

social_data_api_project3 file matches

@tsuchi_ya•Updated 3 days ago
snartapi
papimark21