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=1560&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 17956 results for "api"(1905ms)

getHashratemain.tsx1 match

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

traced_http_valmain.tsx1 match

@saolsen•Updated 1 year ago
4 traced_handler,
5} from "https://esm.town/v/saolsen/tracing?v=126";
6import { trace } from "npm:@opentelemetry/api";
7
8init("traced_http_val");

plausibleREADME.md1 match

@saolsen•Updated 1 year ago
4
5I've been using `saolsen.val-name`.
6Note that there is no auth for the plausible events API, so if somebody forks the val it'll still work but
7track all their val page loads in your dashboard which is kinda weird but also kinda cool, idk.
8

testFetchCommentsValmain.tsx15 matches

@willthereader•Updated 1 year ago
6export const testFetchCommentsVal = async () => {
7 const urls = [
8 "https://www.readtangle.com/members/api/comments/?post_id=0%3A6",
9 "https://www.readtangle.com/members/api/comments/?post_id=0%3A6",
10 "https://www.readtangle.com/members/api/comments/?post_id=0%3A6",
11 "https://www.readtangle.com/members/api/comments/?post_id=0%3A6",
12 "https://www.readtangle.com/members/api/comments/?post_id=0%3A6",
13 "https://www.readtangle.com/members/api/comments/?post_id=0%3A6",
14 "https://www.readtangle.com/members/api/comments/?post_id=0%3A6",
15 "https://www.readtangle.com/members/api/comments/?post_id=0%3A6",
16 "https://www.readtangle.com/members/api/comments/?post_id=0%3A6",
17 "https://www.readtangle.com/members/api/comments/?post_id=0%3A6",
18 "https://www.readtangle.com/members/api/comments/?post_id=0%3A6",
19 "https://www.readtangle.com/members/api/comments/?post_id=0%3A6",
20 "https://www.readtangle.com/members/api/comments/?post_id=0%3A6",
21 "https://www.readtangle.com/members/api/comments/?post_id=0%3A6",
22 "https://www.readtangle.com/members/api/comments/?post_id=0%3A6",
23 ]; // Await the resolution of the promise from testUrlConstructionVal
24 await fetchComments(urls); // Now urls is an array, so it can be passed to fetchComments

runGistmain.tsx1 match

@pomdtr•Updated 1 year ago
27 }
28
29 const gist = await fetchJSON(`https://api.github.com/gists/${id}`);
30 if (gist.owner.login != author) {
31 return new Response("Unauthorized", {

myApimain.tsx1 match

@chrisk_7777•Updated 1 year ago
1let { userCount } = await import("https://esm.town/v/chrisk_7777/userCount");
2
3export function myApi(name) {
4 if (!userCount) {
5 userCount = [];

connect4_mcts_agentmain.tsx1 match

@saolsen•Updated 1 year ago
1import { init, traced_handler } from "https://esm.town/v/saolsen/tracing?v=109";
2import { trace } from "npm:@opentelemetry/api";
3init("connect4_mcts_agent");
4const tracer = trace.getTracer("connect4_mcts_agent");

zohoDeskApimain.tsx1 match

@julbrs•Updated 1 year ago
28): Promise<{ data: Ticket[] }> => {
29 const responseDesk = await axios.get(
30 `https://desk.zoho.com/api/v1/tickets`,
31 {
32 params: {

twitterWrappermain.tsx2 matches

@stevekrouse•Updated 1 year ago
13
14 let url = new URL(req.url);
15 console.log("https://api.twitter.com" + url.pathname + url.search);
16 return Response.json(
17 await twitterJSON({
18 url: "https://api.twitter.com/" + url.pathname + url.search,
19 bearerToken: Deno.env.get("twitter"),
20 }),

twitterWrapperREADME.md1 match

@stevekrouse•Updated 1 year ago
1# Twitter API Wrapper
2
3So that I can share my $100 / month key with a couple Val Town Pro users. Contact me (or comment on this val) if you'd like to get in on the action.

dailyQuoteAPI

@Souky•Updated 1 day ago

HTTP

@Ncharity•Updated 1 day ago
Daily Quote API
Kapil01
apiv1