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%22Image%20title%22?q=api&page=1565&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 18017 results for "api"(9164ms)

fetsREADME.md1 match

@pomdtrUpdated 1 year ago
1# Fets Example
2
3A openapi JSON spec is available at <https://pomdtr-fets.web.val.run/openapi.json>.
4
5You can access a fully typed client with a single import:

sendMsgToSlackmain.tsx1 match

@glommerUpdated 1 year ago
1export async function slackPost(token, channel, text) {
2 const resp = await fetch(
3 `https://slack.com/api/chat.postMessage`,
4 {
5 method: "POST",

p5README.md1 match

@saolsenUpdated 1 year ago
37
38## How it works
39The sketch function returns an http handler that sets up a basic page with p5.js added. It then imports your module from the browser and wires up all the exports so p5.js can see them. All the code in your val will run in the browser (except for the default `sketch` export) so you can't call any Deno functions, environment variables, or other server side apis.
40
41

deno_deploymain.tsx5 matches

@pomdtrUpdated 1 year ago
74 }
75 case "projects": {
76 const resp = await fetchDeployAPI("/projects");
77 if (resp.status != 200) {
78 throw new Error("Failed to fetch projects");
126 }
127 case "playground": {
128 const resp = await fetchDeployAPI(`/projects/${payload.params.project}`);
129 if (resp.status != 200) {
130 throw new Error("Failed to fetch project");
164 const project = payload.params.project;
165
166 const resp = await fetchDeployAPI(`/projects/${project}/deployments`);
167 if (resp.status != 200) {
168 throw new Error("Failed to fetch deployments");
212}
213
214function fetchDeployAPI(endpoint: string, init?: RequestInit) {
215 return fetch(`https://dash.deno.com/api${endpoint}`, {
216 ...init,
217 headers: {

staticmain.tsx1 match

@pomdtrUpdated 1 year ago
35
36 // we check that we are not exposing private vals
37 const resp = await fetch(`https://api.val.town/v1/alias/${author}/${name}`, {
38 headers: {
39 authorization: `Bearer ${Deno.env.get("valtown")}`,

myApimain.tsx1 match

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

plausiblemain.tsx1 match

@saolsenUpdated 1 year ago
1export async function track(domain: string, req: Request) {
2 await fetch("https://plausible.io/api/event", {
3 method: "POST",
4 headers: {

gptApiSchemaBuilderREADME.md1 match

@xkontiUpdated 1 year ago
1Migrated from folder: GPTs/ApiFramework/gptApiSchemaBuilder

gptApiFrameworkREADME.md9 matches

@xkontiUpdated 1 year ago
1Allows for automatic generation of Hono API compatible with GPTs. Endpoints' inputs and outputs need to be specified via types from which the Open API spec is generated automatically and available via `/gpt/schema` endpoint.
2
3> ⚠️ Breaking changes introduced in v23 & 24:
8
9```ts
10import { GptApi } from "https://esm.town/v/xkonti/gptApiFramework";
11import { z } from "npm:zod";
12
22
23/**
24 * INITIALIZE API
25 */
26
27const api = new GptApi({
28 url: "https://xkonti-planoverseerai.web.val.run",
29 title: "Overseer AI API",
30 description: "The API for interacting with the Overseer AI",
31 version: "1.0.0",
32 policyGetter: async () => {
40 */
41
42api.nothingToJson({
43 verb: "POST",
44 path: "/newproblem",
55});
56
57export default api.serve();
58```
59
60Migrated from folder: GPTs/ApiFramework/gptApiFramework

getDifficultiesmain.tsx1 match

@aryanjUpdated 1 year ago
2
3export const handler = async () => {
4 const hashrateResp = await fetch("https://mempool.space/api/v1/mining/hashrate/3y");
5 const { difficulty } = await hashrateResp.json();
6

Apiify9 file matches

@wolfUpdated 10 mins ago

dailyQuoteAPI

@SoukyUpdated 2 days ago
Kapil01
apiv1