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=fetch&page=238&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 2392 results for "fetch"(589ms)

draggableItemsmain.tsx1 match

@nbbaier•Updated 1 year ago
90});
91
92export default app.fetch;

updateValByIDmain.tsx2 matches

@nbbaier•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3interface UpdateValArgs {
20 };
21
22 return fetchJSON(`https://api.val.town/v1/vals/${valId}`, {
23 headers: {
24 Authorization: `Bearer ${token}`,

updateValByNamemain.tsx2 matches

@nbbaier•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3interface UpdateValArgs {
14 };
15
16 return fetchJSON("https://api.val.town/v1/vals", {
17 headers: {
18 Authorization: `Bearer ${token}`,

fetchPaginatedDataREADME.md3 matches

@nbbaier•Updated 1 year ago
1# Fetch Paginated Data
2
3This val exports a function that loops through paginated API responses and returns the combined data as an array. It expects pagination with `next` and there to be a `data` property in the API response. This conforms to the Val Town API, so this function is useful when fetching paginated Val Town API responses for creating custom folders in [pomdtr's vscode extension](https://github.com/pomdtr/valtown-vscode).
4
5Usage:
7```ts
8const id = <vt user id>
9await fetchPaginatedData(`https://api.val.town/v1/users/${id}/vals`, {
10 headers: { Authorization: `Bearer ${Deno.env.get("valtown")}` },
11});

hasValTownStyleGuideUpdatedmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import process from "node:process";
2import { basicAuthorization } from "https://esm.town/v/stevekrouse/basicAuthorization";
3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
4
5export let hasValTownStyleGuideUpdated = async (since: Date) => {
6 let commits = await fetchJSON(
7 "https://api.github.com/repos/val-town/val.town/commits?path=/src/style.tsx&since=" +
8 since.toISOString(),

fetchPaginatedData2 file matches

@nbbaier•Updated 4 days ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago