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/$%7Burl%7D?q=api&page=1398&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 15496 results for "api"(1739ms)

checkResymain.tsx4 matches

@godot•Updated 1 year ago
3export let checkResy = (async () => {
4 const axios = await import("npm:axios");
5 const apiUrl = "https://staging-api.resy.com/3/auth/password";
6 const api_key = "VbWk7s3L4KiK5fzlO7JD3Q5EYolJI7n5";
7 const email = process.env.resyEmail;
8 const password = process.env.resyPassword;
9 const config = {
10 headers: {
11 Authorization: `ResyAPI api_key="${api_key}"`,
12 "Content-Type": "multipart/form-data",
13 },
17 formData.append("password", password);
18 axios
19 .post(apiUrl, formData, config)
20 .then((response) => {
21 console.log(response.data);

spellCheckTestmain.tsx2 matches

@steveb1313•Updated 1 year ago
5 res: express.Response,
6) {
7 let response = await fetch("https://www.dnd5eapi.co/api/spells");
8 let data = await response.json();
9 let countOfSpells = data["count"];
11 let randomSpell = data["results"][randomSpellNumber];
12 let response2 = await fetch(
13 `https://www.dnd5eapi.co/api/spells/${randomSpell["index"]}`,
14 );
15 let data2 = await response2.json();

myApimain.tsx1 match

@spoon•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApimain.tsx1 match

@lol•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApimain.tsx1 match

@sujeet•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

wikitxtmain.tsx1 match

@sdan•Updated 1 year ago
4 try {
5 const wiki = await fetch(
6 `https://en.wikipedia.org/w/api.php?action=query&format=json&titles=${article}&prop=extracts&explaintext`,
7 ).then((res) => res.json());
8 if (!wiki.query) {

twitterAPIDownAlertmain.tsx5 matches

@stevekrouse•Updated 1 year ago
1import { twitterAPIDown } from "https://esm.town/v/stevekrouse/twitterAPIDown";
2
3export async function twitterAPIDownAlert() {
4 if (twitterAPIDown.down)
5 console.email(
6 twitterAPIDown.reason,
7 "Twitter API may be down!"
8 );
9}

runAllTestsmain.tsx8 matches

@stevekrouse•Updated 1 year ago
3export async function runAllTests({
4 names,
5 api,
6}: {
7 names: string[];
8 api: string;
9}) {
10 let validAPI =
11 api.startsWith("http://localhost") ||
12 api.startsWith("https://api.val.town");
13 if (!validAPI) return "bad api";
14 let results = [];
15 for (let name of names) {
16 console.log(
17 `${api}/eval/@stevekrouse.${name}("${encodeURIComponent(api)}")`
18 );
19 results.push(
20 (
21 await fetchJSON(
22 `${api}/eval/@stevekrouse.${name}("${encodeURIComponent(api)}")`
23 )
24 ).data + ` (${name})`

langchainExmain.tsx1 match

@stevekrouse•Updated 1 year ago
7 const model = new OpenAI({
8 temperature: 0.9,
9 openAIApiKey: process.env.openai,
10 maxTokens: 100,
11 });

githubEventsmain.tsx1 match

@stevekrouse•Updated 1 year ago
3// GitHub events
4export let githubEvents = fetchJSON(
5 "https://api.github.com/users/stevekrouse/events"
6);

HN-fetch-call2 file matches

@ImGqb•Updated 2 days ago
fetch HackerNews by API

token-server1 file match

@kwhinnery_openai•Updated 4 days ago
Mint tokens to use with the OpenAI Realtime API for WebRTC
snartapi
Kapil01