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=1567&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 18080 results for "api"(1665ms)

valTownQuotaUseagemain.tsx2 matches

@zarutian•Updated 1 year ago
1// @ts-check js
2import { API_URL } from "https://esm.town/v/std/API_URL";
3const VALTOWN_API_URL = API_URL.concat("/v1");
4import { getMyValTownUserUUID } from "https://esm.town/v/zarutian/getMyValTownUserUUID";
5import { getAllValsOfUser } from "https://esm.town/v/zarutian/getAllValsOfUser";

getMyValTownUserUUIDmain.tsx4 matches

@zarutian•Updated 1 year ago
1// @ts-check
2import { API_URL } from "https://esm.town/v/std/API_URL";
3const VALTOWN_API_URL = API_URL.concat("/v1");
4
5// const VALTOWN_API_URL = "https://api.val.town/v1";
6/**
7 * @returns {Promise<string>} the uuid of the user as an string
8 **/
9export const getMyValTownUserUUID = async () => {
10 return (await (await fetch(`${VALTOWN_API_URL}/me`, {
11 headers: {
12 Authorization: `Bearer ${Deno.env.get("valtown")}`,

llava_recipe_helpermain.tsx1 match

@zeke•Updated 1 year ago
1import process from "node:process";
2import Replicate from "npm:replicate";
3const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN });
4
5const output = await replicate.run(

add_to_notion_w_ai_webpagemain.tsx3 matches

@nerdymomocat•Updated 1 year ago
10const dbid = "DB_ID_GOES_HERE";
11
12const NOTION_API_KEY = process.env.NOTION_API_KEY;
13const notion = new Client({
14 auth: NOTION_API_KEY,
15});
16
31
32const oai = new OpenAI({
33 apiKey: process.env.OPENAI_API_KEY ?? undefined,
34});
35

add_to_notion_w_aimain.tsx3 matches

@nerdymomocat•Updated 1 year ago
6import { z } from "npm:zod";
7
8const NOTION_API_KEY = process.env.NOTION_API_KEY;
9const notion = new Client({
10 auth: NOTION_API_KEY,
11});
12
27
28const oai = new OpenAI({
29 apiKey: process.env.OPENAI_API_KEY ?? undefined,
30});
31

add_to_notion_w_aiREADME.md1 match

@nerdymomocat•Updated 1 year ago
14Supports: checkbox, date, multi_select, number, rich_text, select, status, title, url, email
15
16- Uses `NOTION_API_KEY`, `OPENAI_API_KEY` stored in env variables and uses [Valtown blob storage](https://esm.town/v/std/blob) to store information about the database.
17- Use `get_notion_db_info` to use the stored blob if exists or create one, use `get_and_save_notion_db_info` to create a new blob (and replace an existing one if exists).
18

masto_timeout_prmain.tsx2 matches

@andreterron•Updated 1 year ago
1import { createRestAPIClient } from "npm:masto";
2
3const masto = createRestAPIClient({
4 url: Deno.env.get("MASTO_INSTANCE_URL"),
5 accessToken: Deno.env.get("MASTO_ACCESS_TOKEN"),

trendingreposmain.tsx2 matches

@jamesw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3// Helper function to format the date for GitHub API query
4function formatDate(daysAgo: number): string {
5 const date = new Date();
13 const query = `stars:>${stars} created:>${date}`;
14 const response = await fetch(
15 `https://api.github.com/search/repositories?q=${query}&sort=stars&order=desc&per_page=10`,
16 )
17 .then((res) => res.json());

prune_valmain.tsx3 matches

@saolsen•Updated 1 year ago
5 commit = false,
6): Promise<void> {
7 const resp = await fetch(`https://api.val.town/v1/vals/${val_id}`, {
8 headers: {
9 Authorization: "Bearer " + Deno.env.get("valtown"),
31 console.log(`Deleting Version ${v}`);
32 const resp = await fetch(
33 `https://api.val.town/v1/vals/${val_id}/versions/${v}`,
34 {
35 headers: {
42 if (commit) {
43 const resp = await fetch(
44 `https://api.val.town/v1/vals/${val_id}/versions/${v}`,
45 {
46 method: "DELETE",

manifold_daily_loan_collectormain.tsx2 matches

@case•Updated 1 year ago
1export default async function() {
2 const res = await fetch("https://api.manifold.markets/request-loan", {
3 headers: {
4 Authorization: `Key ${Deno.env.get("manifoldApiKey")}`,
5 },
6 });

Apiify11 file matches

@wolf•Updated 14 hours ago

dailyQuoteAPI

@Souky•Updated 2 days ago
Kapil01
apiv1