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=api&page=960&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 11702 results for "api"(1021ms)

11 },
12) {
13 const url = "https://api.twitter.com/2/oauth2/token";
14 const body = new URLSearchParams({
15 code,

gpt4vDemomain.tsx1 match

@stevekrouseUpdated 1 year ago
2import OpenAI from "npm:openai";
3
4const openai = new OpenAI({ apiKey: process.env.openai });
5
6async function main() {

searchArXiVmain.tsx1 match

@mcgrady20150318Updated 1 year ago
3export const searchArXiV = async ({ query = "", start = 0, max_results = 10 }) => {
4 const { parseStringPromise } = await import("npm:xml2js");
5 const url = new URL("https://export.arxiv.org/api/query");
6 url.searchParams.set("search_query", query);
7 url.searchParams.set("start", start);

simpleClimbingmain.tsx2 matches

@cjpaisUpdated 1 year ago
60 ];
61 // const rawWeatherData = await fetch(
62 // `https://api.climbingweather.com/area/detail/738?days=1`,
63 // ).then((r) => r.json());
64 const rawWeatherData = await Promise.all(
66 a,
67 ) => (await fetch(
68 `https://api.climbingweather.com/area/detail/${a.id}?days=1`,
69 ).then((r) => r.json()).then((d) => ({
70 ...d,

remarkDemoJSXmain.tsx3 matches

@stevekrouseUpdated 1 year ago
10 <style>
11 {`
12 @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
13 @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
14 @import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
15
16 body { font-family: 'Droid Serif'; }

honoTanaEndpointmain.tsx3 matches

@lavacxxUpdated 1 year ago
1import { saveToTana } from "https://esm.town/v/lavacxx/saveToTana";
2import { APIPlainNode } from "https://esm.town/v/lavacxx/tanaTypes";
3import { Hono } from "npm:hono";
4
5const token = Deno.env.get("tanaInputAPI");
6
7export const honoTanaEndpoint = async (req: Request) => {
10 let { text = "" } = await c.req.query();
11 let node = await c.req.json();
12 let payload: APIPlainNode;
13 if (text) {
14 payload.name = text;

runValAPImain.tsx2 matches

@stevekrouseUpdated 1 year ago
1export function runValAPI(name, ...args) {
2 return fetch(`https://api.val.town/v1/run/${name.replace("@", "")}`, {
3 method: "POST",
4 body: JSON.stringify({

runValAPIAuthmain.tsx1 match

@stevekrouseUpdated 1 year ago
7// Make an authenticated request to another user's val
8// Example usage: https://www.val.town/v/stevekrouse.authRequestEx
9export const runValAPIAuth = async ({ val, args, handle, privateKey, keys }: {
10 val: string;
11 args: any;

tursomain.tsx3 matches

@stdUpdated 1 year ago
1import { runValAPIAuth } from "https://esm.town/v/stevekrouse/runValAPIAuth";
2
3// grab the types off turso's client without importing it
6
7export function turso(keys, handle?) {
8 let val = "@std.tursoAPI";
9 let f = (method) => (...args) =>
10 runValAPIAuth({
11 val,
12 args: [method, args],

gptExamplemain.tsx1 match

@stevekrouseUpdated 1 year ago
2import { OpenAI } from "npm:openai";
3
4const openai = new OpenAI({ apiKey: process.env.openai });
5let chatCompletion = await openai.chat.completions.create({
6 messages: [{ role: "user", content: "Make a short joke or pun" }],

new-val-api-21 file match

@shouserUpdated 1 day ago
This is an example of using the API to create a val.

gptApiTemplate2 file matches

@charmaineUpdated 2 days ago
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