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/$%7Bart_info.art.src%7D?q=api&page=1249&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 19269 results for "api"(2448ms)

val_to_project_converterredirect.ts4 matches

@charmaine•Updated 2 months ago
20 }
21
22 const { apiKey, originalVals, projectName, username } = body;
23
24 console.log("Received redirect request:", {
28 });
29
30 if (!apiKey) {
31 return new Response(JSON.stringify({ error: "API key is required" }), {
32 status: 400,
33 headers: { "Content-Type": "application/json" },
49 }
50
51 const result = await redirectOriginalVals(apiKey, originalVals, projectName, username);
52
53 return new Response(JSON.stringify(result), {

farcasterFlingsmain.tsx1 match

@stevekrouse•Updated 2 months ago
2 let FARCASTER_USERNAME = "whatrocks";
3 let flings = await fetch(
4 `https://searchcaster.xyz/api/search?regex=%E2%8C%86&username=${FARCASTER_USERNAME}`,
5 ).then((res) => res.json());
6 let filteredCasts = flings.casts.filter((cast) => cast.body.data.text[0] === "⌆");

GitHubSyncREADME.md3 matches

@tionis•Updated 2 months ago
24 - Ensure the token has read/write access to _Contents_ for the repo
25 - Copy the access token and add that as the `GITHUB_TOKEN` env var in this val
261. Add a new [Val Town API token][] with read/write permissions. Add that token to the val's env vars as `VALTOWN_TOKEN`
271. Add a `VAL_SECRET` env var to the val. Use this secret to sign the webhook POST request to the `/push` endpoint. Use this endpoint to commit vals from Val Town to your GitHub repo.
28
68
69- `GITHUB_TOKEN`: Read/write GitHub personal access token for reading and writing repo contents
70- `VALTOWN_TOKEN`: ValTown API token (with read/write Vals permissions) for writing updates from GitHub
71- `GITHUB_WEBHOOK_SECRET`: secret for verifying webhooks from GitHub
72- `VAL_SECRET`: secret for verifying requests to the `/push` endpoint
98[github oauth app]: https://github.com/settings/developers
99[access token]: https://github.com/settings/tokens
100[val town api token]: https://www.val.town/settings/api
101[troubleshooting]: #troubleshooting
102

reactHonoExample_toowiredApp.tsx2 matches

@toowired•Updated 2 months ago
18
19 try {
20 const response = await fetch("/api/research", {
21 method: "POST",
22 headers: { "Content-Type": "application/json" },
86
87 <div className="footer">
88 <button onClick={() => window.open("/api/view-source", "_blank")} className="view-source">
89 View Source
90 </button>

poorvis885README.md1 match

@poorvis885•Updated 2 months ago
12
13Frontend: React 18, TailwindCSS
14APIs: Open-Meteo, OpenAI GPT-4o
15Hosting: ESM-based module imports

poorvis885main.tsx2 matches

@poorvis885•Updated 2 months ago
47 // Fetch weather data
48 const weatherResponse = await fetch(
49 `https://api.open-meteo.com/v1/forecast?latitude=${location.latitude}&longitude=${location.longitude}&current_weather=true&hourly=temperature_2m,relativehumidity_2m,windspeed_10m`
50 );
51 const weatherData = await weatherResponse.json();
189 setError('');
190 try {
191 const response = await fetch(`https://geocoding-api.open-meteo.com/v1/search?name=${input}&count=1&language=en&format=json`);
192 const data = await response.json();
193 if (data.results && data.results.length > 0) {

weatherDashboardmain.tsx2 matches

@poorvis885•Updated 2 months ago
47 // Fetch weather data
48 const weatherResponse = await fetch(
49 `https://api.open-meteo.com/v1/forecast?latitude=${location.latitude}&longitude=${location.longitude}&current_weather=true&hourly=temperature_2m,relativehumidity_2m,windspeed_10m`
50 );
51 const weatherData = await weatherResponse.json();
189 setError('');
190 try {
191 const response = await fetch(`https://geocoding-api.open-meteo.com/v1/search?name=${input}&count=1&language=en&format=json`);
192 const data = await response.json();
193 if (data.results && data.results.length > 0) {

weatherDashboardREADME.md1 match

@poorvis885•Updated 2 months ago
12
13Frontend: React 18, TailwindCSS
14APIs: Open-Meteo, OpenAI GPT-4o
15Hosting: ESM-based module imports

weatherDashboardmain.tsx1 match

@dhashnamoorthy•Updated 2 months ago
12 try {
13 const response = await fetch(
14 `https://api.open-meteo.com/v1/forecast?latitude=${location.lat}&longitude=${location.lon}&current_weather=true&hourly=temperature_2m,relativehumidity_2m,windspeed_10m`,
15 );
16 const data = await response.json();

todoAppmain.tsx10 matches

@arfan•Updated 2 months ago
39};
40
41const api = {
42 get: async (url: string) => {
43 const response = await fetch(url);
44 if (!response.ok) throw new Error("API request failed");
45 return response.json();
46 },
51 body: JSON.stringify(data),
52 });
53 if (!response.ok) throw new Error("API request failed");
54 return response.json();
55 },
60 body: JSON.stringify(data),
61 });
62 if (!response.ok) throw new Error("API request failed");
63 return response.json();
64 },
65 delete: async (url: string) => {
66 const response = await fetch(url, { method: "DELETE" });
67 if (!response.ok) throw new Error("API request failed");
68 return response.json();
69 },
236 const fetchTodos = async () => {
237 try {
238 const data = await api.get("/todos");
239 setTodos(data);
240 } catch (error) {
268
269 try {
270 await api.post("/todos", newTodo);
271 fetchTodos();
272 } catch (error) {
277 const deleteTodo = async (id: number) => {
278 try {
279 await api.delete(`/todos/${id}`);
280 fetchTodos();
281 } catch (error) {
286 const saveTodoEdits = async (editedTodo: Todo) => {
287 try {
288 await api.put(`/todos/${editedTodo.id}`, editedTodo);
289 setEditingTodo(null);
290 fetchTodos();
445 <meta name="viewport" content="width=device-width, initial-scale=1.0">
446 <title>Todo App</title>
447 <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
448 <style>${css}</style>
449 </head>
Plantfo

Plantfo8 file matches

@Llad•Updated 5 hours ago
API for AI plant info

api_ianmenethil_com133 file matches

@ianmenethil•Updated 14 hours ago
apiry
snartapi