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/?q=api&page=1009&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 11029 results for "api"(1992ms)

honoExampleREADME.md1 match

@antonnymanUpdated 1 year ago
1# Hono
2
3Here's an example using the [Hono](https://hono.dev/) server library with the [Web API](https://docs.val.town/api/web). It works great!
4
5

fetchREADME.md4 matches

@stdUpdated 1 year ago
1# Proxied fetch - [Docs ↗](https://docs.val.town/std/fetch)
2
3The Javascript [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) is directly available within a Val. However sometimes fetch calls are blocked by the receiving server for using particular IP addresses. Additionally, network blips or unreliable web services may lead to failures if not handled properly.
4
5The Val Town standard library contains an alternative version, [`std/fetch`](https://www.val.town/v/std/fetch), that wraps the JavaScript Fetch API to provide additional functionality. The fetch function from [`std/fetch`](https://www.val.town/v/std/fetch) reroutes requests using a proxy vendor so that requests obtain different IP addresses. It also automatically retries failed requests several times. Note that using [`std/fetch`](https://www.val.town/v/std/fetch) will be significantly slower than directly calling the Javascript Fetch API due to extra network hops.
6
7## Usage
8
9After importing [`std/fetch`](https://www.val.town/v/std/fetch), the fetch method is used with the same signature as the Javascript Fetch API.
10
11```ts title="Example" val
12import { fetch } from "https://esm.town/v/std/fetch";
13
14let result = await fetch("https://api64.ipify.org?format=json");
15let json = await result.json();
16console.log(json.ip);

nftImageREADME.md2 matches

@jamiedubsUpdated 1 year ago
1returns image URL (and only image URL) for a given NFT contract + tokenId. Uses Alchemy's NFT API
2
3to this use val, copy the [Web API](https://docs.val.town/api/web) endpoint and use ?query params to specify the contract address and tokenId you want:
4
5<https://jamiedubs-nftimage.web.val.run/?contractAddress=0x3769c5700Da07Fe5b8eee86be97e061F961Ae340&tokenId=666> - FIXME valtown is turning & into "&amp;", you need to fix it. [even like this broken](https://jamiedubs-nftimage.web.val.run/?contractAddress=0x3769c5700Da07Fe5b8eee86be97e061F961Ae340&tokenId=666)

nftMetadataREADME.md2 matches

@jamiedubsUpdated 1 year ago
1use by copying web API endpoint and appending "?contractAddress=...&tokenId..." - here's an example:
2
3https://jamiedubs-nftmetadata.web.val.run/?contractAddress=0x3769c5700Da07Fe5b8eee86be97e061F961Ae340&tokenId=666
5uses [Alchemy](https://docs.alchemy.com/reference/getnftmetadata) for indexed NFT data, via my other [jamiedubs/alchemyClient val](https://www.val.town/v/jamiedubs/alchemyClient)
6
7plus it's using my personal API key. don't abuse this or I'll disable it! yeesh
8
9

snsFromInscriptionREADME.md1 match

@ryanwaitsUpdated 1 year ago
1Migrated from folder: sats_api/snsFromInscription

docFeedbackFormREADME.md1 match

@parkerdavisUpdated 1 year ago
30```
31
32Finally, you may be wondering why I queue up feedback in `@stevekrouse.docsFeedback`, a private JSON val, and then process it via [`@stevekrouse.formFeedbackAlert`](https://www.val.town/v/stevekrouse.formFeedbackAlert) instead of sending it along to Discord directly in this val. I [tried that originally](https://www.val.town/v/stevekrouse.docFeedbackForm?v=61) but it felt too slow to wait for the API call to Discord before returning the "Thanks for your feedback" message. This is where the `context.waitUntil` method (that Cloudflare workers and Vercel Edge Functions support) would really come in handy – those allow you to return a Response, and then continue to compute. Currently Val Town requires you to stop all compute with the returning of your Response, so the only way to compute afterwards is to queue it up for another val to take over, and that's what I'm doing here.
33
34

honoExampleREADME.md1 match

@bisUpdated 1 year ago
1# Hono
2
3Here's an example using the [Hono](https://hono.dev/) server library with the [Web API](https://docs.val.town/api/web). It works great!

thisUrlREADME.md1 match

@wiltUpdated 1 year ago
1Programmatically get the API URLs for the val that calls this val. For example:
2
3```typescript

runPostExampleREADME.md1 match

@neverstewUpdated 1 year ago
1Migrated from folder: docs/api/runPostExample

runGetExampleREADME.md1 match

@neverstewUpdated 1 year ago
1Migrated from folder: docs/api/runGetExample

daily-advice-app1 file match

@dcm31Updated 2 days ago
Random advice app using Advice Slip API

gptApiTemplate1 file match

@charmaineUpdated 3 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