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/$1?q=api&page=1420&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 15445 results for "api"(3756ms)

sendDiscordMessagemain.tsx2 matches

@joey•Updated 1 year ago
1import process from "node:process";
2import { discordAPI } from "https://esm.town/v/joey/discordAPI";
3
4// add the bot to your server before calling:
8// await @joey.sendDiscordMessage('some-channel-id', 'hello world!');
9export const sendDiscordMessage = (channelId: string, message: string) =>
10 discordAPI({
11 path: `/channels/${channelId}/messages`,
12 method: "POST",

boredActivitiesmain.tsx1 match

@simply_say_m•Updated 1 year ago
4export let boredActivities = async () => {
5 const { activity } = await fetchJSON(
6 "https://www.boredapi.com/api/activity",
7 );
8 return activity;

myApimain.tsx1 match

@fishynio•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApimain.tsx1 match

@micmath•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

vibe_playgroundmain.tsx1 match

@ryanguill•Updated 1 year ago
58 </div>
59
60 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
61 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
62</body>

myApimain.tsx1 match

@angusross•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

TodayForTylermain.tsx1 match

@mttlws•Updated 1 year ago
3export async function TodayForTyler(req: express.Request, res: express.Response) {
4 const { activity } = await fetchJSON(
5 "https://www.boredapi.com/api/activity",
6 );
7 return res.send(`

fetchFigmaFilemain.tsx3 matches

@rodrigotello•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchFigmaFile(apiToken, fileKey) {
4 const url = `https://api.figma.com/v1/files/${fileKey}`;
5 const response = await fetch(url, {
6 headers: {
7 "X-FIGMA-TOKEN": apiToken,
8 },
9 });

myApimain.tsx1 match

@olivercole•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApimain.tsx1 match

@danny_engelman•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

HN-fetch-call2 file matches

@ImGqb•Updated 1 day ago
fetch HackerNews by API

token-server1 file match

@kwhinnery_openai•Updated 3 days ago
Mint tokens to use with the OpenAI Realtime API for WebRTC
Kapil01
apiv1