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=931&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 12718 results for "api"(1638ms)

fluxImageGeneratormain.tsx1 match

@isidentical•Updated 8 months ago
1// This app uses the fal.ai API to generate images based on user prompts.
2// It features a clean UI with an input field for the prompt and a button to generate the image.
3// The generated image is displayed below the input field.

fluxImageGeneratorREADME.md1 match

@isidentical•Updated 8 months ago
1Sign in to fal.ai, generate an API key, and set it as `FAL_KEY` for your account.

sqlitemain.tsx4 matches

@gz315200•Updated 8 months ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { LibsqlError, type ResultSet, type Row, type TransactionMode } from "npm:@libsql/client";
3import { z } from "npm:zod";
35
36async function execute(statement: InStatement, args?: InArgs): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
50
51async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
52 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
53 method: "POST",
54 headers: {
78
79/* Val Town's Turso Proxy returns rows as an array of values
80 * Yet the LibSQL API has a Row type which behave as an array or object,
81 * ie you can access it via numerical index or string
82 */

servermain.tsx1 match

@stevekrouse•Updated 8 months ago
75 <title>TLDraw with Saving</title>
76 <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
77 <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@500;700&display=swap"/>
78 <link rel="stylesheet" href="https://esm.sh/@tldraw/tldraw@2.3.0/tldraw.css"/>
79 <style>

calendlyThisWeekEventsmain.tsx3 matches

@ejfox•Updated 8 months ago
1/**
2 * This API integrates with Calendly to fetch personal events for the current week.
3 * It returns the events as raw JSON.
4 *
18 try {
19 // First, get the user's URI
20 const userResponse = await fetch('https://api.calendly.com/users/me', {
21 headers: {
22 'Content-Type': 'application/json',
38
39 // Now fetch the events using the user's URI
40 const eventsUrl = `https://api.calendly.com/scheduled_events?user=${userUri}&min_start_time=${startOfWeek.toISOString()}&max_start_time=${endOfWeek.toISOString()}`;
41
42 const eventsResponse = await fetch(eventsUrl, {

sqlitemain.tsx4 matches

@heaversm•Updated 8 months ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { LibsqlError, type ResultSet, type Row, type TransactionMode } from "npm:@libsql/client";
3import { z } from "npm:zod";
35
36async function execute(statement: InStatement, args?: InArgs): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
50
51async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
52 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
53 method: "POST",
54 headers: {
78
79/* Val Town's Turso Proxy returns rows as an array of values
80 * Yet the LibSQL API has a Row type which behave as an array or object,
81 * ie you can access it via numerical index or string
82 */

googleCalendarWeekEndpointmain.tsx3 matches

@ejfox•Updated 8 months ago
8const REDIRECT_URI = Deno.env.get("REDIRECT_URI"); // Should be set to your Val Town endpoint URL + "/callback"
9
10const SCOPES = ["https://www.googleapis.com/auth/calendar.readonly"];
11
12export default async function server(request: Request): Promise<Response> {
46
47 // Exchange code for tokens
48 const tokenResponse = await fetch("https://oauth2.googleapis.com/token", {
49 method: "POST",
50 headers: {
68
69 const calendarResponse = await fetch(
70 `https://www.googleapis.com/calendar/v3/calendars/primary/events?` +
71 `timeMin=${now.toISOString()}` +
72 `&timeMax=${oneWeekLater.toISOString()}` +

VALLEREADME.md3 matches

@heaversm•Updated 8 months ago
6* Fork this val to your own profile.
7* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
8* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-variables).
9* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environment-variables).
10* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.
11
12<img width=500 src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7077d1b5-1fa7-4a9b-4b93-f8d01d3e4f00/public"/>

valleBlogV0README.md1 match

@heaversm•Updated 8 months ago
1* Fork this val to your own profile.
2* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.
3

valleBlogV0main.tsx1 match

@heaversm•Updated 8 months ago
38 model: openai("gpt-4o", {
39 baseURL: "https://std-openaiproxy.web.val.run/v1",
40 apiKey: Deno.env.get("valtown"),
41 } as any),
42 messages: [

vapi-minutes-db1 file match

@henrywilliams•Updated 17 hours ago

vapi-minutes-db2 file matches

@henrywilliams•Updated 19 hours ago
mux
Your friendly, neighborhood video API.
api