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/$%7Bart_info.art.src%7D?q=api&page=1003&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 11580 results for "api"(3412ms)

myApimain.tsx1 match

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

getInformationOfTheGitHubReposirotymain.tsx2 matches

@tzq•Updated 1 year ago
3
4export async function getInformationOfTheGitHubReposiroty(repository) {
5 return await fetchJSON(`https://api.github.com/repos/${repository}`, {
6 headers: {
7 Accept: "application/vnd.github+json",
8 Authorization: `Bearer ${process.env.githubToken}`,
9 "X-GitHub-Api-Version": "2022-11-28",
10 },
11 })

coolHnPostsmain.tsx1 match

@VictorForissier•Updated 1 year ago
2
3export async function coolHnPosts(id) {
4 return fetch("https://hn.algolia.com/api/v1/search_by_date?tags=author_" + id)
5 .then((res) => res.json())
6 .then((res) => res.hits[0].comment_text);

myApimain.tsx1 match

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

myApimain.tsx1 match

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

myApimain.tsx1 match

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

GetPelotonWorkoutsmain.tsx2 matches

@steveb1313•Updated 1 year ago
6 res: express.Response,
7) {
8 let response = await fetch("https://api.onepeloton.com/auth/login", {
9 method: "POST",
10 mode: "no-cors",
21 const session = await response.json();
22 let workoutResponse = await fetch(
23 `https://api.onepeloton.com/api/user/${session["user_id"]}/workouts`,
24 {
25 method: "GET",

myApimain.tsx1 match

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

boredActivitiesmain.tsx1 match

@roniemeque•Updated 1 year ago
3// Activity suggestions for when you're bored
4export let boredActivities = fetchJSON(
5 "https://www.boredapi.com/api/activity",
6);

getWeatherGovDatamain.tsx2 matches

@wilt•Updated 1 year ago
2
3// Currently broken! Val.Town cannot fetch from .gov sites
4// You can get these input values by calling https://api.weather.gov/points/{latitude},{longitude}
5export async function getWeatherGovData({ office, gridX, gridY }) {
6 const data = await fetchJSON(
7 `https://api.weather.gov/gridpoints/${office}/${gridX},${gridY}/forecast`
8 );
9 return data.properties;

new-val-api-21 file match

@shouser•Updated 2 hours ago
This is an example of using the API to create a val.

gptApiTemplate2 file matches

@charmaine•Updated 1 day ago
apiv1
papimark21