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=972&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"(1770ms)

redSpoonbillmain.tsx1 match

@JoelsrubinUpdated 1 year ago
1export async function getTopTenBattingAverage() {
2 const data = await fetch(
3 "http://sports.core.api.espn.com/v2/sports/baseball/leagues/mlb/seasons/2024/types/2/leaders?lang=en&region=us",
4 );
5 const response = await data.json();

sendNotificationREADME.md1 match

@gwoods22Updated 1 year ago
1# Push Notification Sender
2
3This val can be used in other vals to send notifications to a segment using [OneSignal's REST API](https://documentation.onesignal.com/reference/create-notification)
4
5This is really handy if you want to send push notifications to your phone without building a native app! I built a barebones React PWA that asks for a password then loads the OneSignal Web SDK that I deployed to [Netlify](https://www.netlify.com/) for free. OneSignal has [easy to follow docs](https://documentation.onesignal.com/docs/web-sdk-setup) so you can build this functionality into a React, Angular, Vue app or even Wordpress! Then [install the PWA](https://www.bitcot.com/how-to-install-a-pwa-to-your-device/) on your platform of choice and you're off to the races!

userAgentsmain.tsx1 match

@alexboweUpdated 1 year ago
1// User Agent strings to rotate while scraping.
2// Taken from https://gist.github.com/manthankool/e3b17d126571856198ddfc1bff7775b5/
3export const USER_AGENTS = [

sqliteWasmmain.tsx1 match

@postpostscriptUpdated 1 year ago
1import { DB } from "https://deno.land/x/sqlite/mod.ts";
2import { type InStatement, sqlite as sqliteAPI } from "https://esm.town/v/std/sqlite";
3import { type ResultSet } from "npm:@libsql/client";
4

workerifyExamplemain.tsx1 match

@postpostscriptUpdated 1 year ago
12
13try {
14 await mod.stealAPIKey();
15} catch (e) {
16 console.error(e);

servermain.tsx1 match

@andreterronUpdated 1 year ago
15 <meta name="viewport" content="width=device-width, initial-scale=1" />
16 <style>
17 @import url("https://fonts.googleapis.com/css2?family=Inter:wght@500;700&display=swap");
18 </style>
19 <style type="text/css" src="https://esm.sh/tldraw/tldraw.css"></style>

Server2README.md1 match

@iamseeleyUpdated 1 year ago
9
10#### to do:
11- [ ] create some val town apis for the profile widgets (add vals people have already made)
12- [ ] add profile image (will probably point to val town profile pic)
13- [ ] add delete profile handler

edit_blobmain.tsx1 match

@pomdtrUpdated 1 year ago
1import { api } from "https://esm.town/v/pomdtr/api";
2import { Command } from "https://esm.town/v/pomdtr/cmdk";
3import { blob } from "https://esm.town/v/std/blob?v=12";

view_val_detailmain.tsx2 matches

@pomdtrUpdated 1 year ago
1import { api } from "https://esm.town/v/pomdtr/api";
2import { Command } from "https://esm.town/v/pomdtr/cmdk";
3
4export const viewValDetail: Command = async ({ params }) => {
5 const val = await api(`/v1/vals/${params.val}`, {
6 authenticated: true,
7 });

gsheet_callmain.tsx2 matches

@ynonpUpdated 1 year ago
6 );
7 const googleAuthOptions = {
8 scope: ["https://www.googleapis.com/auth/spreadsheets"],
9 };
10 const token = await getToken(service_account, googleAuthOptions);
11 const result = fetchJSON(
12 `https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`,
13 {
14 method,

vapi-minutes-db2 file matches

@henrywilliamsUpdated 7 hours ago

social_data_api_project3 file matches

@tsuchi_yaUpdated 3 days ago
socialdata
Affordable & reliable alternative to Twitter API: ➡️ Access user profiles, tweets, followers & timeline data in real-time ➡️ Monitor profiles with nearly instant alerts for new tweets, follows & profile updates ➡️ Simple integration
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com