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=1063&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"(1516ms)

myApimain.tsx1 match

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

fetchBcycleCountsmain.tsx2 matches

@jonbo•Updated 1 year ago
3export const fetchBcycleCounts = (async () => {
4 const tokenResponse = await fetch(
5 "https://boulder.bcycle.com/api/bearertoken/getclient?_=1673303289964",
6 {
7 headers: {
24 const tokenData = await tokenResponse.json();
25 const dataResponse = await fetch(
26 "https://portal-den.bcycle.com/1/publicApi/kiosks?programId=54&refresh=true&_=1673303289965",
27 {
28 headers: {

githubGistsmain.tsx1 match

@derrickxyz•Updated 1 year ago
3// GitHub gists
4export let githubGists = fetchJSON(
5 "https://api.github.com/users/stevekrouse/gists"
6);
1## Get All Videos in a Youtube Playlist using the Youtube Data API v3
2
3Reference: https://developers.google.com/youtube/v3/docs/playlistItems/list

docFeedbackFormREADME.md1 match

@timlin•Updated 1 year ago
30```
31
32Finally, you may be wondering why I queue up feedback in `@stevekrouse.docsFeedback`, a private JSON val, and then process it via [`@stevekrouse.formFeedbackAlert`](https://www.val.town/v/stevekrouse.formFeedbackAlert) instead of sending it along to Discord directly in this val. I [tried that originally](https://www.val.town/v/stevekrouse.docFeedbackForm?v=61) but it felt too slow to wait for the API call to Discord before returning the "Thanks for your feedback" message. This is where the `context.waitUntil` method (that Cloudflare workers and Vercel Edge Functions support) would really come in handy – those allow you to return a Response, and then continue to compute. Currently Val Town requires you to stop all compute with the returning of your Response, so the only way to compute afterwards is to queue it up for another val to take over, and that's what I'm doing here.
33
34

checkBPPRequirementREADME.md2 matches

@lbb00•Updated 1 year ago
4
5```
6https://api.val.town/v1/run/lbb00.checkBPPRequirement?args=[imageUrl,minDisplayWidth,minDisplayHeight]
7```
8
9[Example](https://api.val.town/v1/run/lbb00.checkBPPRequirement?args=[%22https://images.tusiassets.com/models/600411993916047362/P-xfmxxeYNrnq6fYtRo79.jpeg!mfit_w480_h480_jpg_webp%22,320,320])
10
11Migrated from folder: Demo/checkBPPRequirement

callGoogleSheetsAPIREADME.md2 matches

@clayway•Updated 1 year ago
1Wrapper around Google Sheets API v4.
2You will need:
3
4- a Google Cloud service account
5- the Google Sheets API v4 enabled in your Google Cloud project
6- the spreadsheet ID (provide it in the sheetId parameter)
7

testApiREADME.md1 match

@clayway•Updated 1 year ago
1Migrated from folder: Archive/testApi

API_URLREADME.md4 matches

@std•Updated 1 year ago
1# Val Town API URL
2
3When Val Town code is run on Val Town servers we use a local URL so we can save time by skipping a roundtrip to the public internet. However, if you want to run your vals that use our API, ie std library vals, locally, you'll want to use our public API's URL, `https://api.val.town`. We recommend importing and using `std/API_URL` whenever you use our API so that you are always using the most efficient route.
4
5## Example Usage
6
7```ts
8import { API_URL } from "https://esm.town/v/std/API_URL";
9
10const response = await fetch(`${API_URL}/v1/me`, {
11 headers: {
12 Authorization: `Bearer ${Deno.env.get("valtown")}`,

honoExampleREADME.md1 match

@antonnyman•Updated 1 year ago
1# Hono
2
3Here's an example using the [Hono](https://hono.dev/) server library with the [Web API](https://docs.val.town/api/web). It works great!
4
5

new-val-api-21 file match

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

gptApiTemplate2 file matches

@charmaine•Updated 1 day ago
apiv1
papimark21