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/$%7Bsuccess?q=api&page=981&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 12205 results for "api"(1911ms)

API_URLmain.tsx2 matches

@stdUpdated 1 year ago
2 // try/catch prevents crashes if the script doesn't have env access
3 try {
4 return Deno.env.get("VALTOWN_API_URL");
5 } catch {}
6}
7
8export const API_URL = envOrUndefined("VALTOWN_API_URL") ?? "https://api.val.town";

chat_openaimain.tsx2 matches

@cosmoUpdated 1 year ago
1const { default: OpenAI } = await import("npm:openai");
2
3export async function chat(apiKey, messages) {
4 const openai = new OpenAI({ apiKey });
5
6 return openai.chat.completions.create({

draftReadmemain.tsx2 matches

@nbbaierUpdated 1 year ago
25async function getVal(username: string, valName: string) {
26 try {
27 const res = await fetch(`https://api.val.town/v1/alias/${username}/${valName}`, {
28 method: "GET",
29 headers: {
67async function updateReadme(id: string, readme: string) {
68 try {
69 const res = await fetch(`https://api.val.town/v1/vals/${id}`, {
70 method: "PUT",
71 headers: {

readmeGPTmain.tsx3 matches

@nbbaierUpdated 1 year ago
6 model: string;
7 openai: OpenAI;
8 apiKey: string;
9 valtownKey: string;
10
32 private async getVal(username: string, valName: string) {
33 try {
34 const res = await fetch(`https://api.val.town/v1/alias/${username}/${valName}`, {
35 method: "GET",
36 headers: {
72 private async updateReadme(id: string, readme: string) {
73 try {
74 const res = await fetch(`https://api.val.town/v1/vals/${id}`, {
75 method: "PUT",
76 headers: {

sqliteWritermain.tsx2 matches

@nbbaierUpdated 1 year ago
10 table: string;
11 model: string;
12 apiKey: string;
13 openai: OpenAI;
14
17 this.table = table;
18 this.model = model;
19 // this.apiKey = openaiOptions.apiKey ? openaiOptions.apiKey : Deno.env.get("OPENAI_API_KEY");
20 this.openai = new OpenAI(openaiOptions);
21 }

readmeGPTREADME.md2 matches

@nbbaierUpdated 1 year ago
30```
31
32## API Reference
33
34### Class: ReadmeWriter
43
44- `model` (optional): The model to be used for generating the readme. Defaults to "gpt-3.5-turbo".
45- `apiKey` (optional): An OpenAI API key. Defaults to `Deno.env.get("OPENAI_API_KEY")`.
46
47#### Methods

sqliteWriterREADME.md2 matches

@nbbaierUpdated 1 year ago
365. Handle the generated query or query result according to your application's needs.
37
38## API
39
40### `new QueryWriter(args: { table: string; model?: string }): QueryWriter`
44- `table`: The name of the database table to operate on.
45- `model` (optional): The model to use for generating SQL queries. Defaults to "gpt-3.5-turbo".
46- `apiKey` (optional): An OpenAI API key. Defaults to `Deno.env.get("OPENAI_API_KEY")`.
47
48

valTownQuotaUseagemain.tsx2 matches

@zarutianUpdated 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

@zarutianUpdated 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

@zekeUpdated 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(

social_data_api_project3 file matches

@tsuchi_yaUpdated 2 days ago

simple-scrabble-api1 file match

@bryUpdated 5 days ago
papimark21
socialdata
Affordable & reliable alternative to Twitter API: ➡️ Access user profiles, tweets, followers & timeline data in real-time ➡️ Monitor profiles with nearly instant alerts for new tweets, follows & profile updates ➡️ Simple integration