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/?q=api&page=1583&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 17970 results for "api"(6706ms)

untitled_blushLobstermain.tsx1 match

@aravgoyalneu•Updated 1 year ago
3 async function fetchRandomJoke() {
4 const response = await fetch(
5 "<https://official-joke-api.appspot.com/random_joke>",
6 );
7 return response.json();

untitled_harlequinDingomain.tsx1 match

@juwang110•Updated 1 year ago
2 async function fetchRandomJoke() {
3 const response = await fetch(
4 "<https://official-joke-api.appspot.com/random_joke>",
5 );
6 return response.json();

getVersionmain.tsx1 match

@jpwilliams•Updated 1 year ago
7 }
8
9 const targetUrl = `https://api.github.com/repos/${username}/${repo}/releases/latest`;
10
11 const headers = request.headers;

whiteCondormain.tsx1 match

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

modelmain.tsx1 match

@jacoblee93•Updated 1 year ago
3const model = new ChatOpenAI({
4 temperature: 0.9,
5 openAIApiKey: @me.secrets.OPENAI_API_KEY,
6});
7

handlerREADME.md1 match

@maxjoygit•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

feedmain.tsx1 match

@darcy•Updated 1 year ago
4export function feed() {
5 let _feed = following.map(async (name) => {
6 let req = await fetch(`https://api.val.town/v1/run/${name}.posts`);
7 let res = (req.status === 200) ? req.json() : {};
8 return res;

glifJsonmain.tsx1 match

@jamiedubs•Updated 1 year ago
4 const searchParams = new URL(req.url).searchParams;
5 const id = searchParams.get("id");
6 const url = `https://glif.app/api/glifs?id=${id}`;
7 try {
8 const response = await fetch(url);

glifsmain.tsx1 match

@jamiedubs•Updated 1 year ago
2
3export const glifs = async (id: string) => {
4 const url = `https://glif.app/api/glifs?featured=1`;
5 try {
6 const response = await fetch(url);

gpt4ExampleREADME.md1 match

@stevekrouse•Updated 1 year ago
3This uses the brand new `gpt-4-1106-preview`.
4
5To use this, set `OPENAI_API_KEY` in your [Val Town Secrets](https://www.val.town/settings/secrets).
6
7Migrated from folder: Archive/IntroVideo/gpt4Example

dailyQuoteAPI

@Souky•Updated 1 day ago

HTTP

@Ncharity•Updated 1 day ago
Daily Quote API
Kapil01
apiv1