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/image-url.jpg%20%22Optional%20title%22?q=api&page=1077&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 11753 results for "api"(2604ms)

getRandomArticleInCategorymain.tsx2 matches

@fab1anUpdated 1 year ago
12 const encodedCategory = encodeURIComponent(category.replace(/ /g, "_"));
13 const listUrl =
14 `https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:${encodedCategory}&cmlimit=500&format=json&origin=*`;
15 const listResponse = await fetch(listUrl);
16 const listData = await listResponse.json();
25 ].title;
26 const contentUrl =
27 `https://en.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&titles=${
28 encodeURIComponent(randomArticle)
29 }&format=json&utf8=1&origin=*`;

mathFactmain.tsx1 match

@dosirakUpdated 1 year ago
3// Random math fact
4export let mathFact = fetchText(
5 "http://numbersapi.com/random/math"
6);

githubGistsmain.tsx1 match

@eagle251Updated 1 year ago
3// GitHub gists
4export let githubGists = fetchJSON(
5 "https://api.github.com/users/stevekrouse/gists"
6);

TanaPasteExamplemain.tsx4 matches

@bikefixeUpdated 1 year ago
1export async function TanaPasteExample(req, res) {
2 // you call this functioin from Tana's make API request
3 // as https://api.val.town/express/@bikefixe.TanaPasteExample?arg=stufftopassin
4 // then you'd call the API where the data you want resides
5 // a search term might've been passed in
6 // const url = https://something@domain.com?searchterm=${req.query.arg}
17 };
18 // then build a string in Tana Paste format.
19 // if you're working from a Make API request command,
20 // then the %%tana%% header isn't required
21 const outputString = `- ${dummy.name} #mysupertag

myApimain.tsx1 match

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

myApimain.tsx1 match

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

getMemain.tsx1 match

@neverstewUpdated 1 year ago
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export let getMe = fetchJSON(`https://api.val.town/v1/me`, {
5 headers: {
6 Authorization: `Bearer ${process.env.valtownToken}`,

heapifymain.tsx1 match

@aeschylusUpdated 1 year ago
1export let heapify = (arr) => {
2 // maxHeap
3 const swapDown = (arr, n, i) => {

stockPriceVizmain.tsx1 match

@joemccourtUpdated 1 year ago
8 const d = params.get("d");
9 const resData = await fetchJSON(
10 `https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=${symbol}&interval=${d}min&apikey=${process.env.alphaVantage}`,
11 );
12 const data = {

myApimain.tsx1 match

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

new-val-api-21 file match

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

gpt-image-test

@CaptainJackUpdated 16 hours ago
测试 gpt image 的不同 api 能否满足图片生成要求
apiv1
papimark21