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=1001&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 11580 results for "api"(3100ms)

telegramGetUpdatesmain.tsx1 match

@vtdocs•Updated 1 year ago
3export const telegramGetUpdates = async (botToken: string) =>
4 fetchJSON(
5 `https://api.telegram.org/bot${botToken}/getUpdates`,
6 );

myApimain.tsx1 match

@jwshin•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApimain.tsx1 match

@beorn•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

generateQRmain.tsx2 matches

@galligan•Updated 1 year ago
1// fetch("https://api.val.town/v1/express/galligan.generateQR?url={url}"
2// QR Code Generator
3// 1. Right click on the bookmarks bar and add new bookmark
4// 2. Give it any name (Ex: QR Code)
5// 3. For the URL, enter the below value
6// javascript:void(open('https://api.val.town/v1/express/ramkarthik.generateQR?url='+encodeURIComponent(location.href), 'Open this URL', 'width=200,height=275'))
7// 4. Save the bookmark
8// 5. When you are on any page, click the newly added bookmark

bitlyShortenLinkmain.tsx2 matches

@galligan•Updated 1 year ago
1import { bitlyAPI } from "https://esm.town/v/galligan/bitlyAPI";
2
3export let bitlyShortenLink = async ({ long_url, token, domain, group_guid }) =>
4 bitlyAPI({
5 token,
6 endpoint: "shorten",

nameNationalitymain.tsx1 match

@rodrigotellovaltown•Updated 1 year ago
3// Predict the nationality of a name
4export let nameNationality = fetchJSON(
5 "https://api.nationalize.io/?name=michael"
6);

capitalizemain.tsx1 match

@parthraghav•Updated 1 year ago
1export const capitalize = (txt: string) => {
2 var sentences = txt.split(/[.!?]/);
3 for (var i = 0; i < sentences.length; i++) {

githubEventsmain.tsx1 match

@neverstew•Updated 1 year ago
3// GitHub events
4export let githubEvents = fetchJSON(
5 "https://api.github.com/users/stevekrouse/events"
6);

commentsmain.tsx1 match

@neverstew•Updated 1 year ago
35}> {
36 return fetchJSON(
37 "https://api.val.town/v1/me/comments?" +
38 searchParams({
39 relationship: relationship,

untitled4881419main.tsx2 matches

@byrneml•Updated 1 year ago
1// Get news from different sources I care about
2export let untitled4881419 = interface LeNews {
3 feedlyAPI: {
4 name: String,
5 desc: String,
8}
9
10export async function giveMeLeNews({ feedlyAPI }: LeNews) {
11 return "Works";
12}

new-val-api-21 file match

@shouser•Updated 2 hours ago
This is an example of using the API to create a val.

gptApiTemplate2 file matches

@charmaine•Updated 1 day ago
apiv1
papimark21