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=843&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 11489 results for "api"(2258ms)

valwritermain.tsx1 match

@janpaul123•Updated 9 months ago
106 console.log(result.rows[0]);
107
108 // Blob storage API
109 import { blob } from "https://esm.town/v/std/blob";
110 const key = "blob_test";

spotifymain.tsx5 matches

@hunty•Updated 9 months ago
25
26export let spotifyRequestToken = ({ client_id, client_secret, code, redirect_uri }) =>
27 fetchJSON("https://accounts.spotify.com/api/token", {
28 method: "POST",
29 body: querystring({
39
40export let spotifyRefreshToken = async ({ refresh_token, client_id, client_secret }) =>
41 fetch("https://accounts.spotify.com/api/token", {
42 method: "POST",
43 body: new URLSearchParams({
191
192 try {
193 const currentlyPlaying = await fetch("https://api.spotify.com/v1/me/player/currently-playing", {
194 method: "GET",
195 headers: {
207
208 if (!mostRecentTrack) {
209 const recentTracks = await fetch("https://api.spotify.com/v1/me/player/recently-played", {
210 method: "GET",
211 headers: {
232
233 try {
234 const playStateResponse = await fetch("https://api.spotify.com/v1/me/player?market=US", {
235 method: "GET",
236 headers: {

twitterSearchmain.tsx1 match

@stevekrouse•Updated 10 months ago
14}): Promise<TweetResult[]> {
15 const res = await twitterJSON({
16 url: `https://api.twitter.com/2/tweets/search/recent?query=${await searchParams(
17 {
18 query,

twitterSearchmain.tsx1 match

@jamiedubs•Updated 10 months ago
14}): Promise<TweetResult[]> {
15 const res = await twitterJSON({
16 url: `https://api.twitter.com/2/tweets/search/recent?query=${await searchParams(
17 {
18 query,

easyAQIREADME.md1 match

@rishabhparikh•Updated 10 months ago
3Get the Air Quality Index (AQI) for a location via open data sources.
4
5It's "easy" because it strings together multiple lower-level APIs to give you a simple interface for AQI.
6
71. Accepts a location in basically any string format (ie "downtown manhattan")

notifymain.tsx1 match

@samwho•Updated 10 months ago
17 }
18
19 const resp = await fetch("https://api.pushover.net/1/messages.json", {
20 headers: {
21 "Content-Type": "application/json",

randomCardImagemain.tsx1 match

@jamiedubs•Updated 10 months ago
4 try {
5 const response = await fetch(
6 "https://deckofcardsapi.com/api/deck/new/draw/?count=1",
7 );
8 const data = await response.json();

streammain.tsx10 matches

@tempguy•Updated 10 months ago
35 const { id } = c.req.param();
36 const post_data = `fid=${id.split(".")[1]}&share_key=${id.split(".")[0]}`;
37 const streamApiRequest = await fetch(`https://www.febbox.com/file/player?${post_data}`, {
38 method: "POST",
39 headers: headers,
40 });
41 const urlResponse = await streamApiRequest.text();
42 console.log(urlResponse);
43 const regex = /\{"type":(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/g;
69 const _tv = (type === "S") ? `.${season}.1` : "";
70 console.log(_tv);
71 const idApiRequest = await fetch(`https://api.dmdb.network/v1/gmid/${type}.${tmdb}${_tv}`);
72 const idApiJson = await idApiRequest.json();
73 console.log(idApiJson);
74 if (idApiRequest.status === 404 || idApiJson["ids"].length === 0) {
75 return c.json([]);
76 }
77
78 const mode = type === "M" ? 1 : 2;
79 const sheguId = idApiJson["ids"]["superstream"];
80 const showbox = await fetch(`https://www.showbox.media/index/share_link?id=${sheguId}&type=${mode}`, {
81 headers: headers,
92 ? await scrapeSeriesFiles(febboxItemJson, febboxId, season, episode)
93 : await scrapeMoviesFiles(febboxItemJson, febboxId);
94 const apiResponse = {
95 id: "",
96 type: "SERIES",
99 for (const item of febboxFiles.data.file_list) {
100 if (item.file_icon === "video_icon")
101 apiResponse.media.push({
102 id: `${febboxId}.${item.fid}`,
103 name: item.file_name,
110 });
111 }
112 return c.json(apiResponse);
113});
114async function scrapeMoviesFiles(directoryList, febboxId: string) {

googleGenerativeAIStreamingExamplemain.tsx1 match

@tr3ntg•Updated 10 months ago
1import { GoogleGenerativeAI } from "npm:@google/generative-ai";
2export default async function(req: Request): Promise<Response> {
3 const genAI = new GoogleGenerativeAI(Deno.env.get("your-api-key"));
4 const generativeModel = genAI.getGenerativeModel({
5 model: "gemini-1.5-flash-001",

googleGenerativeAIStreamingExampleREADME.md1 match

@tr3ntg•Updated 10 months ago
5**Prerequisite:**
6
7Follow Google's [Getting Started guide](https://ai.google.dev/gemini-api/docs/get-started/tutorial?lang=node) to get an API key and view some example methods.
8
9Migrated from folder: Utilities/googleGenerativeAIStreamingExample

gptApiTemplate2 file matches

@charmaine•Updated 4 hours ago

mod-interview-api1 file match

@twschiller•Updated 21 hours ago
apiv1
papimark21