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/$%7Burl%7D?q=fetch&page=792&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 8143 results for "fetch"(1955ms)

getCommentsREADME.md1 match

@neverstew•Updated 1 year ago
1# GET /v1/me/comments
2Fetches information about any comments on vals.
3
4Requires a secret called valtownToken, set to your API Token. See more about [authentication](https://docs.val.town/api/authentication) to understand how to generate a token.

getLikesREADME.md1 match

@neverstew•Updated 1 year ago
1# GET /v1/me/likes
2Fetches information about any val you "like".
3
4Requires a secret called valtownToken, set to your API Token. See more about [authentication](https://docs.val.town/api/authentication) to understand how to generate a token.

duckdbExampleREADME.md1 match

@tmcw•Updated 1 year ago
1# DuckDB
2
3[DuckDB](https://duckdb.org/) works on Val Town, with only one small tweak! We're basically using DuckDB in the same way you'd use it with a browser - using the WASM package with its dependencies fetched from [jsdelivr](https://www.jsdelivr.com/).
4
5The only trick is to create the worker ourselves rather than using `duckdb.createWorker`. DuckDB's built-in createWorker method doesn't specify a worker type, which causes `type` to default to `classic`, and Deno (our runtime) doesn't support classic workers.

lichessPgnREADME.md1 match

@jdan•Updated 1 year ago
1Fetches the PGN for a [Lichess](https://lichess.org) game.
2
3Migrated from folder: lichess/lichessPgn

getRunsREADME.md1 match

@neverstew•Updated 1 year ago
1# GET /v1/me/runs
2
3Fetches information about runs of any val you author.
4
5Requires a secret called valtownToken, set to your API Token. See more about [authentication](https://docs.val.town/api/authentication) to understand how to generate a token.

getMeREADME.md1 match

@neverstew•Updated 1 year ago
1# GET `/v1/me`
2Fetches information about yourself.
3
4Requires a secret called `valtownToken`, set to your API Token. See more about [authentication](https://docs.val.town/api/authentication) to understand how to generate a token.

handleFetchTextResponseREADME.md1 match

@devdoshi•Updated 1 year ago
1Migrated from folder: webpush/handleFetchTextResponse

whatIsMyIpREADME.md1 match

@devdoshi•Updated 1 year ago
1I wanted to see if val.town forwards my client IP Address using the x-forwarded-for header, which it does, but cloudflare provides the True-Client-IP header as well. When you run a val on the website, it is actually running from val's servers so it won't come from your client IP. You'll need to copy the express fetch and run that from your client.
2
3Migrated from folder: helpers/whatIsMyIp

arenaApiExampleREADME.md1 match

@tmcw•Updated 1 year ago
3Example of using the [are.na](https://dev.are.na/documentation/channels#Block43472) API to get the contents of an Are.na board - specifically my fun board that showcases websites with that "glossy black style."
4
5All you need is [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to make this happen!
6
7Migrated from folder: API_Examples/arenaApiExample

kyExampleREADME.md2 matches

@tmcw•Updated 1 year ago
1# ky
2
3The [ky module](https://www.npmjs.com/package/ky) is a nice abstraction around the [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API), which is easily compatible with Deno. It's by the same creator as [got](https://npmjs.com/got), which more explicitly targets Node.js.
4
5Most of the time, the `fetch` method is all you need! But in a pinch, you can use `ky` to make things a little fancier.
6
7Migrated from folder: Modules/kyExample

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago