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/image-url.jpg%20%22Optional%20title%22?q=api&page=10&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 11746 results for "api"(1767ms)

slacktransform.tsx4 matches

@dinavinterUpdated 21 hours ago
6 * inputs, perform calculations, and provide outputs. Functions can
7 * be used independently or as steps in workflows.
8 * https://api.slack.com/automation/functions/custom
9 */
10export const SampleFunctionDefinition = DefineFunction({
41 * definition (see above), as well as a function that contains
42 * handler logic that's run when the function is executed.
43 * https://api.slack.com/automation/functions/custom
44 */
45export default SlackFunction(
49
50 // inputs.user is set from the interactivity_context defined in sample_trigger.ts
51 // https://api.slack.com/automation/forms#add-interactivity
52 const updatedMsg = `:wave: ` + `<@${inputs.user}>`
53 + ` submitted the following message: \n\n>${inputs.message}`;
60
61 // Save the sample object to the datastore
62 // https://api.slack.com/automation/datastores
63 const putResponse = await client.apps.datastore.put({
64 datastore: "SampleObjects",

slackdatastore.ts1 match

@dinavinterUpdated 21 hours ago
4 * Datastores are a Slack-hosted location to store
5 * and retrieve data for your app.
6 * https://api.slack.com/automation/datastores
7 */
8const SampleObjectDatastore = DefineDatastore({

telegramBotStarterbotFunctions.js5 matches

@asdfgUpdated 22 hours ago
327
328// ============================================================
329// TELEGRAM API INTERACTION
330// ============================================================
331
332/**
333 * Send a message using the Telegram API
334 */
335async function sendTelegramMessage(chatId, text) {
337 const botToken = process.env.TELEGRAM_BOT_TOKEN;
338
339 const response = await fetch(`https://api.telegram.org/bot${botToken}/sendMessage`, {
340 method: "POST",
341 headers: { "Content-Type": "application/json" },
367 const botToken = process.env.TELEGRAM_BOT_TOKEN;
368
369 const response = await fetch(`https://api.telegram.org/bot${botToken}/setWebhook`, {
370 method: "POST",
371 headers: { "Content-Type": "application/json" },
391 const botToken = process.env.TELEGRAM_BOT_TOKEN;
392
393 const response = await fetch(`https://api.telegram.org/bot${botToken}/getWebhookInfo`);
394 const result = await response.json();
395 return result;

my-first-val02_http.tsx2 matches

@stevekrouseUpdated 22 hours ago
10
11 // Look up the user's location from their IP
12 const geoResponse = await fetch(`http://ip-api.com/json/${ip}`);
13 const geoData = await geoResponse.json();
14
26 <style>
27 {`
28 @import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');
29 body { font-family: 'Share Tech Mono', monospace; background: #0a0a0a; color: #00ff00; }
30 .glow { text-shadow: 0 0 10px #00ff00; }
44}
45
46// Helper for Discord API requests
47async function discordRequest(endpoint: string, options: any = {}) {
48 const url = `https://discord.com/api/v10/${endpoint}`;
49 const headers = {
50 Authorization: `Bot ${Deno.env.get("DISCORD_BOT_TOKEN")}`,
63 if (!res.ok) {
64 const error = await res.json();
65 console.error(`❌ Discord API error: ${res.status}`, error);
66 throw new Error(`Discord API error: ${res.status} ${error.message}`);
67 }
68
106 console.log(`📤 Sending follow-up message: ${content}`);
107 try {
108 await fetch(`https://discord.com/api/v10/webhooks/${applicationId}/${interactionToken}/messages/@original`, {
109 method: "PATCH",
110 headers: {

glastonewsindex.ts1 match

@bensomethingUpdated 23 hours ago
2import fetch from "node:node-fetch"; // Ensure this is installed if not already
3import process from "node:process";
4import { BskyAgent } from "npm:@atproto/api";
5
6// Create a Bluesky Agent
57 : `applications/${DISCORD_APP_ID}/commands`;
58
59 console.log(`📡 Using API endpoint: ${endpoint}`);
60
61 try {
65
66 // Register the commands
67 const response = await fetch(`https://discord.com/api/v10/${endpoint}`, {
68 method: "PUT",
69 headers: {

Townieschema.tsx2 matches

@pomdtrUpdated 1 day ago
18 finish_reason?: string;
19 num_images?: number;
20 our_api_token: boolean;
21}
22
43 finish_reason TEXT,
44 num_images INTEGER,
45 our_api_token INTEGER NOT NULL,
46 finish_timestamp INTEGER
47 )

TownieuseProject.tsx2 matches

@pomdtrUpdated 1 day ago
2import { useAuth } from "./useAuth.tsx";
3
4const PROJECT_ENDPOINT = "/api/project";
5const FILES_ENDPOINT = "/api/project-files";
6
7export function useProject (projectId: string, branchId?: string) {

TownieuseProjects.tsx1 match

@pomdtrUpdated 1 day ago
2import { useAuth } from "./useAuth.tsx";
3
4const ENDPOINT = "/api/projects-loader";
5
6export function useProjects () {

gpt-image-test

@CaptainJackUpdated 11 hours ago
测试 gpt image 的不同 api 能否满足图片生成要求

new-val-api-21 file match

@shouserUpdated 1 day ago
This is an example of using the API to create a val.
papimark21
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