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/$%7Bart_info.art.src%7D?q=api&page=958&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 12322 results for "api"(2611ms)

redSpoonbillmain.tsx1 match

@Joelsrubin•Updated 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

@gwoods22•Updated 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

@alexbowe•Updated 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

@postpostscript•Updated 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

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

servermain.tsx1 match

@andreterron•Updated 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

@iamseeley•Updated 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

@pomdtr•Updated 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

@pomdtr•Updated 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

@ynonp•Updated 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,

social_data_api_project3 file matches

@tsuchi_ya•Updated 2 days ago

simple-scrabble-api1 file match

@bry•Updated 5 days ago
api
aquapi