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%20%22Optional%20title%22?q=api&page=1664&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 18269 results for "api"(1864ms)

myApimain.tsx1 match

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

getPoemForTimemain.tsx1 match

@crsven•Updated 1 year ago
3export let getPoemForTime = async (time: string) => {
4 const poemResponse = await fetch(
5 `https://poem.town/api/v1/clock/poem/${time}`
6 );
7 const poemJson = await poemResponse.json();

postToMastodonmain.tsx2 matches

@sebdd•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export function postToMastodon(mastodonApiUrl, mastodonAccessToken, status) {
4 return fetch(
5 `${mastodonApiUrl}/statuses?access_token=${mastodonAccessToken}`,
6 {
7 headers: {

postWebhookTestmain.tsx1 match

@ggarnhart•Updated 1 year ago
2
3export let postWebhookTest = fetchJSON(
4 "https://api.val.town/express/@ggarnhart.citiBikeSpotChecker",
5 {
6 method: "POST",

chatSampleFunctionSinglemain.tsx1 match

@webup•Updated 1 year ago
4export const chatSampleFunctionSingle = (async () => {
5 // Example dummy function hard coded to return the same weather
6 // In production, this could be your backend API or an external API
7 const getCurrentWeather = (location, unit = "fahrenheit") => ({
8 unit,

chatmain.tsx4 matches

@steveb1313•Updated 1 year ago
6 options = {},
7) => {
8 // Initialize OpenAI API stub
9 const { Configuration, OpenAIApi } = await import("https://esm.sh/openai");
10 const configuration = new Configuration({
11 apiKey: process.env.openAIAPI,
12 });
13 const openai = new OpenAIApi(configuration);
14 // Request chat completion
15 const messages = typeof prompt === "string"

captureCalendlyWebhookmain.tsx1 match

@ianvph•Updated 1 year ago
21 };
22 capturePostHogEvent(
23 process.env.phProjectAPIKey,
24 user,
25 eventName,

myApimain.tsx1 match

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

bigLeagueMemain.tsx1 match

@nuklearfiziks•Updated 1 year ago
1export const bigLeagueMe = async (req: Request) => {
2 const params = Object.fromEntries(new URL(req.url).searchParams.entries());
3 var {default: atproto} = await import("npm:@atproto/api");
4
5 const BskyAgent = atproto.

createQdrantCollectionmain.tsx2 matches

@wilt•Updated 1 year ago
3/**
4 * Create a new Qdrant collection in an existing cluster with the given name
5 * Uses recommended values for OpenAPI embeddings
6 */
7export async function createQdrantCollection(args: {
16 method: "PUT",
17 headers: {
18 "api-key": qdrantKey,
19 "Content-Type": "application/json",
20 },

github-api1 file match

@cricks_unmixed4u•Updated 6 hours ago

beeminder-api4 file matches

@cricks_unmixed4u•Updated 7 hours ago
Kapil01
apiv1