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=889&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 10995 results for "api"(1794ms)

glifsmain.tsx1 match

@jamiedubs•Updated 1 year ago
2
3export const glifs = async (id: string) => {
4 const url = `https://glif.app/api/glifs?featured=1`;
5 try {
6 const response = await fetch(url);

gpt4ExampleREADME.md1 match

@stevekrouse•Updated 1 year ago
3This uses the brand new `gpt-4-1106-preview`.
4
5To use this, set `OPENAI_API_KEY` in your [Val Town Secrets](https://www.val.town/settings/secrets).
6
7Migrated from folder: Archive/IntroVideo/gpt4Example

emojiSearchBotmain.tsx2 matches

@stevekrouse•Updated 1 year ago
6import OpenAI from "npm:openai";
7
8const openai = new OpenAI({ apiKey: process.env.openai });
9
10export async function emojiSearchBot({ lastRunAt }: Interval) {
14 }&expansions=attachments.media_keys&media.fields=duration_ms,height,media_key,preview_image_url,public_metrics,type,url,width,alt_text`;
15 const result = await twitterJSON({
16 url: `https://api.twitter.com/2/users/1721850098575908864/mentions` + query,
17 bearerToken: process.env.twitter,
18 });

refreshTwitterTokenmain.tsx1 match

@andreterron•Updated 1 year ago
9 },
10) {
11 const url = "https://api.twitter.com/2/oauth2/token";
12 const body = new URLSearchParams({
13 grant_type: "refresh_token",

twitterRequestAccessTokenmain.tsx1 match

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

gpt4vDemomain.tsx1 match

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

searchArXiVmain.tsx1 match

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

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

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

@lavacxx•Updated 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;

daily-advice-app1 file match

@dcm31•Updated 2 days ago
Random advice app using Advice Slip API

gptApiTemplate1 file match

@charmaine•Updated 3 days ago
mux
Your friendly, neighborhood video API.
api