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=995&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 12052 results for "api"(1240ms)

remarkDemoJSXmain.tsx3 matches

@stevekrouseUpdated 1 year ago
10 <style>
11 {`
12 @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
13 @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
14 @import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
15
16 body { font-family: 'Droid Serif'; }

honoTanaEndpointmain.tsx3 matches

@lavacxxUpdated 1 year ago
1import { saveToTana } from "https://esm.town/v/lavacxx/saveToTana";
2import { APIPlainNode } from "https://esm.town/v/lavacxx/tanaTypes";
3import { Hono } from "npm:hono";
4
5const token = Deno.env.get("tanaInputAPI");
6
7export const honoTanaEndpoint = async (req: Request) => {
10 let { text = "" } = await c.req.query();
11 let node = await c.req.json();
12 let payload: APIPlainNode;
13 if (text) {
14 payload.name = text;

runValAPImain.tsx2 matches

@stevekrouseUpdated 1 year ago
1export function runValAPI(name, ...args) {
2 return fetch(`https://api.val.town/v1/run/${name.replace("@", "")}`, {
3 method: "POST",
4 body: JSON.stringify({

runValAPIAuthmain.tsx1 match

@stevekrouseUpdated 1 year ago
7// Make an authenticated request to another user's val
8// Example usage: https://www.val.town/v/stevekrouse.authRequestEx
9export const runValAPIAuth = async ({ val, args, handle, privateKey, keys }: {
10 val: string;
11 args: any;

tursomain.tsx3 matches

@stdUpdated 1 year ago
1import { runValAPIAuth } from "https://esm.town/v/stevekrouse/runValAPIAuth";
2
3// grab the types off turso's client without importing it
6
7export function turso(keys, handle?) {
8 let val = "@std.tursoAPI";
9 let f = (method) => (...args) =>
10 runValAPIAuth({
11 val,
12 args: [method, args],

gptExamplemain.tsx1 match

@stevekrouseUpdated 1 year ago
2import { OpenAI } from "npm:openai";
3
4const openai = new OpenAI({ apiKey: process.env.openai });
5let chatCompletion = await openai.chat.completions.create({
6 messages: [{ role: "user", content: "Make a short joke or pun" }],

tanaSavemain.tsx3 matches

@nbbaierUpdated 1 year ago
1import { saveToTana } from "https://esm.town/v/nbbaier/saveToTana";
2import { APIPlainNode } from "https://esm.town/v/nbbaier/tanaTypes";
3import { Hono } from "npm:hono";
4
5const token = Deno.env.get("tanaInputAPI");
6
7export const tanaSave = async (req: Request) => {
10 let { text, url } = c.req.query();
11
12 const payload: APIPlainNode = {
13 name: text,
14 children: [

saveToTanamain.tsx8 matches

@nbbaierUpdated 1 year ago
1import { TanaAPIHelper } from "https://esm.town/v/nbbaier/TanaAPIHelper";
2import { tanaConstants } from "https://esm.town/v/nbbaier/tanaConstants";
3import { APIPlainNode } from "https://esm.town/v/nbbaier/tanaTypes";
4
5/** saveToTana - creates a node in Tana via the Tana Input API
6 * @param {string} token - Token for accessing the API.
7 * @param {APIPlainNode} node - Data node to be created in Tana.
8 * @param {string} targetNodeId - ID of the target node where the new node will be attached (defaults to the inbox)
9 * @returns {Promise<APIPlainNode>} - A promise that resolves to the created node.
10 */
11export const saveToTana = async (
12 token: string,
13 node: APIPlainNode,
14 targetNodeId: string = tanaConstants.inboxNodeId,
15) => {
16 const client = new TanaAPIHelper(token);
17 const createdNode = await client.createNode(node, targetNodeId);
18 return createdNode;

tanaTypesmain.tsx12 matches

@nbbaierUpdated 1 year ago
1export type APIDataType = "boolean" | "plain" | "date" | "url" | "reference";
2
3export type NodeType = "node" | undefined;
4
5export type CommonNodeProps = {
6 dataType?: APIDataType;
7 type?: NodeType;
8};
9
10export type APICheckboxNode = {
11 value: boolean;
12} & CommonNodeProps;
13
14export type APIDateNode = {
15 name: string;
16} & CommonNodeProps;
17
18export type APIReferenceNode = {
19 id: string;
20} & CommonNodeProps;
21
22export type APIFileNode = {
23 file: string;
24 contentType: string;
26} & CommonNodeProps;
27
28export type APINode = APIPlainNode | APIDateNode | APIReferenceNode | APIFileNode;
29export type APIFieldValue = APINode | APICheckboxNode;
30
31export type APIPlainNode = {
32 name: string;
33 description?: string;
34 supertags?: { id: string }[];
35 children?: (APIField | APINode)[];
36} & CommonNodeProps;
37
38export type APIField = {
39 type: "field";
40 attributeId: string;
41 children?: (APIPlainNode | APINode | APICheckboxNode)[];
42};
43

saveToTanaREADME.md6 matches

@nbbaierUpdated 1 year ago
1# Save To Tana
2
3This val provides a function `saveToTana` allows the creation of nodes in [Tana](https://tana.inc/) via their [Input API](https://github.com/tanainc/tana-input-api-samples). The parameters are as follows:
4- **Token:** to access the Tana Input API, you must pass an API token to the function. Obtain an API token from the Tana app and save it as a secret in Val Town.
5- **Node:** the node that is created within Tana is passed as the second argument and must conform to the shape of an Input API node (see the [documentation](https://github.com/tanainc/tana-input-api-samples) on github for details.
6- **Target node:** optionally, you can specify a specific target node by passing a node ID to the function as it's third argument.
7
12```ts
13import { saveToTana } from "https://esm.town/v/nbbaier/saveToTana";
14import { APIPlainNode } from "https://esm.town/v/nbbaier/tanaTypes";
15import { Hono } from "npm:hono";
16
17const token = Deno.env.get("tanaInputAPI");
18
19export const honoTanaEndpoint = async (req: Request) => {
22 let { text, url } = c.req.query();
23
24 const payload: APIPlainNode = {
25 name: text,
26 children: [

social_data_api_project3 file matches

@tsuchi_yaUpdated 1 day ago

simple-scrabble-api1 file match

@bryUpdated 4 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