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/$%7Bsuccess?q=api&page=994&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 12053 results for "api"(1305ms)

handlerREADME.md1 match

@maxjoygit•Updated 1 year ago
1# Hono
2
3Here's an example using the [Hono](https://hono.dev/) server library with the [Web API](https://docs.val.town/api/web). It works great!
4
5

feedmain.tsx1 match

@darcy•Updated 1 year ago
4export function feed() {
5 let _feed = following.map(async (name) => {
6 let req = await fetch(`https://api.val.town/v1/run/${name}.posts`);
7 let res = (req.status === 200) ? req.json() : {};
8 return res;

glifJsonmain.tsx1 match

@jamiedubs•Updated 1 year ago
4 const searchParams = new URL(req.url).searchParams;
5 const id = searchParams.get("id");
6 const url = `https://glif.app/api/glifs?id=${id}`;
7 try {
8 const response = await fetch(url);

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);

social_data_api_project3 file matches

@tsuchi_ya•Updated 1 day ago

simple-scrabble-api1 file match

@bry•Updated 4 days ago
snartapi
papimark21