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=987&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 11754 results for "api"(2771ms)

tootLatestPostsmain.tsx1 match

@sebddUpdated 1 year ago
12 .map((item) =>
13 postToMastodon(
14 "https://mastodon.social/api/v1",
15 process.env.mastodonAccessToken,
16 `${item.title.charAt(0) === "↗" ? "🔗" : "✍️"} ${

topLichessmain.tsx1 match

@jdanUpdated 1 year ago
7 | "Bullet"
8 | "Computer"
9 | "Rapid"
10 | "Top Rated"
11 | "Blitz"

myApimain.tsx1 match

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

pipeSampleLLMToolmain.tsx2 matches

@webupUpdated 1 year ago
4
5export const pipeSampleLLMTool = (async () => {
6 const { SerpAPI } = await import("npm:langchain/tools");
7 const { PromptTemplate } = await import("npm:langchain/prompts");
8 const { StringOutputParser } = await import(
9 "npm:langchain/schema/output_parser"
10 );
11 const search = new SerpAPI(process.env.SERP);
12 const prompt = PromptTemplate.fromTemplate(
13 `Turn the following user input into a search query for a search engine:

testcase1main.tsx1 match

@swyxUpdated 1 year ago
1import { fetchJSON } from "https://esm.town/v/swyx/fetchJSON";
2
3export let testcase1 = fetchJSON('https://api.val.town/eval/@stevekrouse.messages')
4
5// export state = () => {

starWarsmain.tsx2 matches

@axel_sbUpdated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Explore the Star Wars universe, from StarWarsAPI
4export let starWars = fetchJSON(
5 "https://swapi.dev/api/people/1/"
6);

artICGetRandommain.tsx1 match

@wiltUpdated 1 year ago
2
3export const artICGetRandom = (limit: number = 1) =>
4 fetchJSON("https://api.artic.edu/api/v1/search", {
5 method: "POST",
6 headers: {

axiosExmain.tsx1 match

@stevekrouseUpdated 1 year ago
1export const axiosEx = (async () => {
2 const { default: axios } = await import("https://esm.sh/axios");
3 let r = await axios.get("https://api.github.com/users/stevekrouse/following");
4 return JSON.stringify(r);
5})();

openaiOpenAPImain.tsx7 matches

@stevekrouseUpdated 1 year ago
1export let openaiOpenAPI = `
2openapi: 3.0.0
3info:
4 title: Val Town API
5 description: |
6 The Val Town API provides services to evaluate JavaScript and TypeScript expressions, run vals as APIs, either as functions or Express handlers.
7
8 Learn more at [https://docs.val.town](https://docs.val.town)
10servers:
11 - url: https://stevekrouse-chatgptplugin.express.val.run
12 description: Val Town API v1
13
14components:
17 type: http
18 scheme: bearer
19 bearerFormat: API Key
20 schemas:
21 JSON:
71 summary: "id"
72 description: |
73 This val is a function that returns its arguments. It is useful for testing how the API handles the arguments passed to it.
74
75 View the val at [https://val.town/v/stevekrouse.id](https://val.town/v/stevekrouse.id)

googleOauthDebugmain.tsx1 match

@stevekrouseUpdated 1 year ago
3export const googleOauthDebug = (async () => {
4 const client = await googleClient();
5 const scopes = ["https://www.googleapis.com/auth/calendar"];
6 const authorizationUrl = client.generateAuthUrl({
7 scope: scopes,

new-val-api-21 file match

@shouserUpdated 1 hour ago
This is an example of using the API to create a val.

gpt-image-test

@CaptainJackUpdated 17 hours ago
测试 gpt image 的不同 api 能否满足图片生成要求
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