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?q=api&page=1006&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 12539 results for "api"(1935ms)

magentaDogmain.tsx1 match

@NegashUpdated 1 year ago
8}
9
10// API Endpoint to increment the number
11// Example endpoint: /increment
12app.post('/increment', (req, res) => {

queryParamsREADME.md1 match

@trclUpdated 1 year ago
1# Handling query params in requests
2
3Using the standard [URL#searchParams](https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams) method, you can grab query parameters out of any val that is operating using the [Web API](https://docs.val.town/api/web).
4
5This val demonstrates how to grab one or more query parameters. It returns the all the query parameters found as a json response.

twitterAlertREADME.md1 match

@pomdtrUpdated 1 year 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

apiProxymain.tsx4 matches

@postpostscriptUpdated 1 year ago
1import { api as apiRaw } from "https://esm.town/v/pomdtr/api?v=9";
2import { authMiddlewareToken } from "https://esm.town/v/postpostscript/authMiddleware";
3import { getValEndpointFromUrl } from "https://esm.town/v/postpostscript/meta";
6
7export const SCOPES = {
8 "request/*": "make an API request as you",
9};
10
21 const req = c.req.raw;
22 console.log(c.req.path);
23 return fetch(`https://api.val.town${c.req.path}`, {
24 method: req.method,
25 body: req.body,
33
34const ENDPOINT = getValEndpointFromUrl(import.meta.url);
35export function api(path: string, token: string, init: RequestInit = {}) {
36 return fetch(`${ENDPOINT}/${path.replace(/^\/+/, "")}`, {
37 ...init,

whiteXerinaemain.tsx2 matches

@stevekrouseUpdated 1 year ago
23 <head>
24 <title>SQLite Explorer</title>
25 <link rel="preconnect" href="https://fonts.googleapis.com" />
26 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
27 <link
28 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
29 rel="stylesheet"
30 />

whiteXerinaeREADME.md1 match

@stevekrouseUpdated 1 year ago
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans

whiteThrushmain.tsx2 matches

@stevekrouseUpdated 1 year ago
22 <head>
23 <title>SQLite Explorer</title>
24 <link rel="preconnect" href="https://fonts.googleapis.com" />
25 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
26 <link
27 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
28 rel="stylesheet"
29 />

whiteThrushREADME.md1 match

@stevekrouseUpdated 1 year ago
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans

password_authmain.tsx3 matches

@stevekrouseUpdated 1 year ago
61
62async function fetchUser(token: string): Promise<{ id: string }> {
63 const resp = await fetch("https://api.val.town/v1/me", {
64 headers: {
65 Authorization: `Bearer ${token}`,
74}
75
76async function verifyApiToken(token: string) {
77 try {
78 const [currentUser, requestUser] = await Promise.all([fetchUser(Deno.env.get("valtown")), fetchUser(token)]);
146 const formData = await req.formData();
147 const password = formData.get("password") as string;
148 if (!passwords.includes(password) && !(await verifyApiToken(password))) {
149 return new Response("Unauthorized", {
150 status: 403,

password_authREADME.md2 matches

@stevekrouseUpdated 1 year ago
11## Usage
12
13If you want to use an [api token](https://www.val.town/settings/api) to authenticate:
14
15```ts
41```
42
43Note that authenticating using your api token is always an option.
44
45## TODO

vapi-minutes-db2 file matches

@henrywilliamsUpdated 11 hours ago

social_data_api_project3 file matches

@tsuchi_yaUpdated 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