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=1647&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 18034 results for "api"(4648ms)

githubWebhookApproveDependencyPRsmain.tsx6 matches

@karfau•Updated 1 year ago
13 const webhookSecret = process.env.githubWebhookApproveDependencyPRs;
14 // the token to make github requests (needs `repo` permissions)
15 const githubApiToken = process.env.githubApproveDependencyPRsToken;
16 const valHttpUrl = thisValUrl();
17 const approvalMessage = `Automatically approved by ${valHttpUrl}`;
48 const { Octokit } = await import("npm:@octokit/core");
49 const octokit = new Octokit({
50 auth: githubApiToken,
51 });
52 const { repository, organization } = payload;
66 const checks = (await octokit.request(pr.statuses_url, {
67 headers: {
68 "X-GitHub-Api-Version": "2022-11-28",
69 },
70 })).data;
80 branch: pull_request.base.ref,
81 headers: {
82 "X-GitHub-Api-Version": "2022-11-28",
83 },
84 },
102 event: "APPROVE",
103 headers: {
104 "X-GitHub-Api-Version": "2022-11-28",
105 },
106 },
131};
132// Forked from @vtdocs.githubWebhookWithVerify
133// switched from express to WebApi using https://www.val.town/v/neverstew.githubWebhookApproveDependencyPRs

myApimain.tsx1 match

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

valTownApiExampleUsermain.tsx2 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let valTownApiExampleUser = (async () => {
4 const handle = "tmcw";
5 const response = await fetch(`https://api.val.town/v1/alias/${handle}`);
6 const json = await response.json();
7 return json;

githubStarredmain.tsx1 match

@stevekrouse•Updated 1 year ago
3// Cities named Brooklyn
4export let githubStarred = fetchJSON(
5 "https://api.github.com/users/stevekrouse/starred",
6);

openAqNowcastAQImain.tsx1 match

@stevekrouse•Updated 1 year ago
5export async function openAqNowcastAQI({ location_id }) {
6 const { results } = await fetchJSON(
7 "https://api.openaq.org/v2/measurements?" +
8 new URLSearchParams({
9 limit: "100",

importGistsmain.tsx1 match

@stevekrouse•Updated 1 year ago
7 const supportedLanguages = ["JavaScript", "TypeScript"];
8 let imported = [];
9 const headers = { "X-GitHub-Api-Version": "2022-11-28" };
10 const { Octokit } = await import("npm:@octokit/core");
11 const octokit = new Octokit({ auth: githubToken });

myApimain.tsx1 match

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

myApimain.tsx1 match

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

nasaAPODmain.tsx1 match

@iBrokeit•Updated 1 year ago
3// returns NASA's Astronomy Picture of the Day (APOD)
4export const nasaAPOD = fetchJSON(
5 "api.nasa.gov/planetary/apod?api_key=DEMO_KEY",
6);

myApimain.tsx1 match

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

Apiify11 file matches

@wolf•Updated 3 hours ago

dailyQuoteAPI

@Souky•Updated 2 days ago
Kapil01
apiv1