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=989&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 13058 results for "api"(1163ms)

gitReleaseNotesmain.tsx1 match

@kylemUpdated 9 months ago
45
46async function getGithubReleases(repo: string): Promise<GithubRelease[]> {
47 const response = await fetch(`https://api.github.com/repos/${repo}/releases`);
48 if (!response.ok) {
49 throw new Error(`Failed to fetch releases from ${repo}`);

blobmain.tsx1 match

@janpaul123Updated 9 months ago
1// This implementation uses SQLite to store blob data instead of the Val Town API.
2// It creates a 'blobs' table to store key-value pairs, where the key is the blob key
3// and the value is the blob data stored as TEXT. This approach allows for persistence

anthropicProxymain.tsx6 matches

@cephalizationUpdated 9 months ago
13 }
14
15 // Check that your valtown API key is sent in the 'x-authorization' header
16 // Delete this line if you don't mind other parties hitting this endpoint
17 if (req.headers.get("x-authorization") !== Deno.env.get("valtown")) {
24 try {
25 const body = await req.json();
26 const apiKey = req.headers.get("x-api-key");
27
28 if (!body) {
30 }
31
32 if (!apiKey) {
33 throw new Error("No API key provided");
34 }
35
36 const anthropic = new Anthropic({ apiKey });
37
38 if (body?.stream) {
57 }
58 } catch (e) {
59 if (e instanceof Anthropic.APIError) {
60 return Response.json(e.error, { status: e.status });
61 }

discordBotmain.tsx1 match

@augustveixUpdated 9 months ago
96 const data = await response;
97 const update = await fetch(
98 `https://discord.com/api/v10/webhooks/${body.application_id}/${body.token}/messages/@original`,
99 {
100 method: "PATCH",

anthropicProxyREADME.md1 match

@cephalizationUpdated 9 months ago
3THIS IS NO LONGER NECESSARY
4
5This Val will proxy anthropic HTTP requests from some frontend client, like langchain, so that you can utilize anthropic apis from the browser.
6
7Convert it to an HTTP val in order to use it (you may want to setup an ENV var / header to protect the endpoint with a secret key)

twitterAlertREADME.md1 match

@tmcwUpdated 9 months ago
13Change the `query` variable for what you want to get notified for.
14
15You can use [Twitter's search operators](https://developer.twitter.com/en/docs/twitter-api/v1/rules-and-filtering/search-operators) to customize your query, for some collection of keywords, filtering out others, and much more!
16
17## 3. Notification

scarletEgretmain.tsx1 match

@willthereaderUpdated 9 months ago
3async function getOpenAI() {
4 // if you don't have a key, use our std library version
5 if (Deno.env.get("OPENAI_API_KEY") === undefined) {
6 const { OpenAI } = await import("https://esm.town/v/std/openai");
7 return new OpenAI();

openaimain.tsx1 match

@willthereaderUpdated 9 months ago
3async function getOpenAI() {
4 // if you don't have a key, use our std library version
5 if (Deno.env.get("OPENAI_API_KEY") === undefined) {
6 const { OpenAI } = await import("https://esm.town/v/std/openai");
7 return new OpenAI();

chatmain.tsx1 match

@willthereaderUpdated 9 months ago
3async function getOpenAI() {
4 // if you don't have a key, use our std library version
5 if (Deno.env.get("OPENAI_API_KEY") === @std/openai) {
6 const { OpenAI } = await import("https://esm.town/v/std/openai");
7 return new OpenAI();

subaudioREADME.md1 match

@stevekrouseUpdated 9 months ago
3Speech-to-text and chapter summaries powered by [Substrate](https://substrate.run)
4
5🪩 To fork, [sign up for Substrate](https://substrate.run/signin) to get your own API key and $50 free credits
6
7Migrated from folder: Archive/subaudio

vapi-minutes-db1 file match

@henrywilliamsUpdated 2 days ago

vapi-minutes-db2 file matches

@henrywilliamsUpdated 2 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