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?q=api&page=1008&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 12456 results for "api"(1725ms)

twemojimain.tsx7 matches

@stevedylandevUpdated 1 year ago
35}
36
37export const apis = {
38 twemoji: (code: string) =>
39 `https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${
56const emojiCache: Record<string, Promise<string>> = {};
57
58export async function loadEmoji (type: keyof typeof apis, code: string) {
59 const key = `${type}:${code}`;
60
63 }
64
65 if (!type || !apis[type]) {
66 type = "twemoji";
67 }
68
69 const api = apis[type];
70
71 if (typeof api === "function") {
72 return (emojiCache[key] = fetch(api(code)).then(async r => r.text()));
73 }
74 return (emojiCache[key] = fetch(`${api}${code.toUpperCase()}.svg`).then(async r =>
75 r.text()));
76}

getWeathermain.tsx6 matches

@chetUpdated 1 year ago
2import process from "node:process";
3
4/** Must set process.env.WEATHER_API_KEY for weatherapi.com **/
5export async function getWeather(
6 query: string,
7 days = 10,
8): Promise<WeatherApiResponse> {
9 const weatherApiKey = process.env.WEATHER_API_KEY;
10 const q = encodeURIComponent(query);
11 const apiUrl = `https://api.weatherapi.com/v1/forecast.json?key=${weatherApiKey}&q=${q}&days=${days}`;
12 const response = await fetch(apiUrl);
13 const data: any = await response.json();
14 return data;
15}
16
17type WeatherApiResponse = {
18 location: {
19 name: string;

MusicAPI2README.md4 matches

@nishuiUpdated 1 year ago
1API:`https://nishui-MusicAPI2.web.val.run?id=xxx`
2
3id 是网易云的音乐 id 值,使用此 API 将会访问网页的两个 API 去获取音乐信息和歌词信息
4
5我们用 req.url 获取 API 的url,然后再获取 url 的参数 id,这样就获取到对应的参数 id 了
6
72024年03月25日 不知道什么原因,获取 song 的 detail 失败,说是 `querystring/url must match format \"uri\`
8
9Migrated from folder: MusicPlatform/MusicAPI2

greenhouseToRSSmain.tsx2 matches

@donmccurdyUpdated 1 year ago
6 const account = searchParams.get("account");
7 const mode = searchParams.get("mode");
8 const SOURCE_URL = `https://boards-api.greenhouse.io/v1/boards/${account}/jobs`;
9 const { jobs: sourceJobs } = await fetch(SOURCE_URL).then((res) => res.json());
10
12 const feed = new Feed({
13 title: `Jobs: ${account} (via Greenhouse)`,
14 description: "Job postings automatically forwarded from Greenhouse API to RSS.",
15 id: getFeedLink(mode),
16 link: "https://www.val.town/v/donmccurdy.greenhouseToRSS",

leverToRSSmain.tsx1 match

@donmccurdyUpdated 1 year ago
7 const account = searchParams.get("account");
8 const mode = searchParams.get("mode");
9 const SOURCE_URL = `https://api.lever.co/v0/postings/${account}?mode=xml`;
10 const parser = new XMLParser();
11 const sourceXML = await fetch(SOURCE_URL).then((res) => res.text());

createValmain.tsx1 match

@neverstewUpdated 1 year ago
39 };
40
41 return fetchJSON("https://api.val.town/v1/vals", {
42 headers: {
43 Authorization: `Bearer ${token}`,

updateValByIDmain.tsx1 match

@nbbaierUpdated 1 year ago
20 };
21
22 return fetchJSON(`https://api.val.town/v1/vals/${valId}`, {
23 headers: {
24 Authorization: `Bearer ${token}`,

updateValByNamemain.tsx1 match

@nbbaierUpdated 1 year ago
14 };
15
16 return fetchJSON("https://api.val.town/v1/vals", {
17 headers: {
18 Authorization: `Bearer ${token}`,

spotify_helpersmain.tsx1 match

@stevekrouseUpdated 1 year ago
35 </li>
36 <li>If your access token expires, we use the refresh token to get a new one.</li>
37 <li>Use your access token to make requests to the Spotify API.</li>
38 </ol>
39

spotify_helpersREADME.md1 match

@stevekrouseUpdated 1 year ago
1Migrated from folder: External_APIs/spotify/spotify_helpers

vapi-minutes-db2 file matches

@henrywilliamsUpdated 4 hours ago

social_data_api_project3 file matches

@tsuchi_yaUpdated 3 days ago
papimark21
socialdata
Affordable & reliable alternative to Twitter API: ➡️ Access user profiles, tweets, followers & timeline data in real-time ➡️ Monitor profiles with nearly instant alerts for new tweets, follows & profile updates ➡️ Simple integration