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/$%7Bsuccess?q=api&page=968&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 12626 results for "api"(2106ms)

convertResumemain.tsx12 matches

@iamseeleyUpdated 11 months ago
86 }
87
88 /* API Key Input Styles */
89 #apiKeyInput {
90 display: none;
91 margin-top: 10px;
108 <div class="buttons">
109 <div class="hosting">
110 <input type="text" id="apiKeyInput" placeholder="Enter your Val Town API Key">
111 <button id="hostButton">Host Resume on Val Town</button>
112 </div>
122 event.preventDefault();
123 const resumeContent = document.getElementById('resumeContent').value;
124 const apiKey = '${Deno.env.get("OPENAI_API_KEY")}';
125 const spinner = document.getElementById('spinner');
126 const jsonOutput = document.getElementById('jsonOutput');
127 const copyButton = document.getElementById('copyButton');
128 const hostButton = document.getElementById('hostButton');
129 const apiKeyInput = document.getElementById('apiKeyInput');
130
131 spinner.style.display = 'block';
133 copyButton.style.display = 'none';
134 hostButton.style.display = 'none';
135 apiKeyInput.style.display = 'none';
136
137 try {
138 const jsonResume = await convertToResumeJSON(resumeContent, apiKey);
139 jsonOutput.textContent = JSON.stringify(JSON.parse(jsonResume), null, 2);
140 copyButton.style.display = 'block';
141 hostButton.style.display = 'block';
142 apiKeyInput.style.display = 'block';
143 } catch (error) {
144 jsonOutput.textContent = 'An error occurred while converting the resume.';
153 document.getElementById('hostButton').addEventListener('click', async function() {
154 const jsonOutput = document.querySelector('#jsonOutput').innerText;
155 const valTownApiKey = document.getElementById('apiKeyInput').value; // Get the Val Town API key from input
156
157 if (!valTownApiKey) {
158 alert('Please enter your Val Town API Key.');
159 return;
160 }
161
162 try {
163 const hostedUrl = await hostResume(JSON.parse(jsonOutput), valTownApiKey);
164 alert('Resume hosted at: ' + hostedUrl);
165 window.open(hostedUrl, '_blank');

blobAdminREADME.md1 match

@yawnxyzUpdated 11 months ago
9[![](https://stevekrouse-button.express.val.run/Install)](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
12
13# TODO

hostResumemain.tsx5 matches

@iamseeleyUpdated 11 months ago
1export async function hostResume(jsonResume, apiKey) {
2 const userDetailsEndpoint = 'https://api.val.town/v1/me/';
3 const createValEndpoint = 'https://api.val.town/v1/vals/';
4
5 // get user details
7 method: 'GET',
8 headers: {
9 'Authorization': `Bearer ${apiKey}`
10 }
11 });
22 method: 'POST',
23 headers: {
24 'Authorization': `Bearer ${apiKey}`,
25 'Content-Type': 'application/json'
26 },

sqliteExplorerAppREADME.md1 match

@adrianmgUpdated 11 months 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

sqliteExplorerAppmain.tsx2 matches

@adrianmgUpdated 11 months ago
26 <head>
27 <title>SQLite Explorer</title>
28 <link rel="preconnect" href="https://fonts.googleapis.com" />
29
30 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
31 <link
32 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"
33 rel="stylesheet"
34 />

purpleKangaroomain.tsx1 match

@willthereaderUpdated 11 months ago
3import { renderToString } from "npm:react-dom/server";
4
5// This uses by personal API key, you'll need to provide your own if
6// you fork this. We'll be adding support to the std/openai lib soon!
7const openai = new OpenAI();

valBackupmain.tsx11 matches

@iamseeleyUpdated 11 months ago
1import { ValTownAPI } from 'https://esm.town/v/iamseeley/ValTownAPI';
2import { GitHubAPI } from 'https://esm.town/v/iamseeley/GitHubAPI';
3
4const VAL_TOWN_API_KEY = Deno.env.get('valtown');
5const GITHUB_TOKEN = Deno.env.get("GITHUB_TOKEN");
6const GITHUB_REPO = "iamseeley/vals-backup";
7const GITHUB_BRANCH = "main";
8
9const valTownAPI = new ValTownAPI(VAL_TOWN_API_KEY);
10const gitHubAPI = new GitHubAPI(GITHUB_TOKEN);
11
12async function fetchVals() {
13 const response = await valTownAPI.getAllVals();
14 return response.data;
15}
18 console.log(`Fetching existing files from repo: ${GITHUB_REPO}, branch: ${GITHUB_BRANCH}`);
19 try {
20 const response = await gitHubAPI.getRepoContent(GITHUB_REPO, "", GITHUB_BRANCH);
21 console.log("Existing files:", response);
22 return response.map(file => file.path);
32
33 for (const file of files) {
34 const commitHistory = await gitHubAPI.getCommitHistory(GITHUB_REPO, file, GITHUB_BRANCH);
35 lastModifiedDates[file] = new Date(commitHistory[0].commit.committer.date).getTime();
36 }
46 if (fileExists) {
47 console.log(`File exists: ${filePath}`);
48 const shaResponse = await gitHubAPI.getRepoContent(GITHUB_REPO, filePath, GITHUB_BRANCH);
49 const sha = shaResponse.sha;
50 console.log(`Fetched SHA for ${filePath}: ${sha}`);
52 throw new Error(`Failed to fetch SHA for ${filePath}`);
53 }
54 await gitHubAPI.updateFile(GITHUB_REPO, filePath, fileContent, sha, commitMessage, GITHUB_BRANCH);
55 console.log(`File updated: ${filePath}`);
56 } else {
57 console.log(`File does not exist: ${filePath}`);
58 await gitHubAPI.createFile(GITHUB_REPO, filePath, fileContent, commitMessage, GITHUB_BRANCH);
59 console.log(`File created: ${filePath}`);
60 }

GitHubAPImain.tsx6 matches

@iamseeleyUpdated 11 months ago
1export class GitHubAPI {
2 constructor(private token: string) {}
3
4 async getRepoContent(repo: string, path: string, branch: string) {
5 const response = await fetch(`https://api.github.com/repos/${repo}/contents/${path}?ref=${branch}`, {
6 method: 'GET',
7 headers: {
18
19 async getFileSHA(repo: string, path: string, branch: string) {
20 const response = await fetch(`https://api.github.com/repos/${repo}/contents/${path}?ref=${branch}`, {
21 method: 'GET',
22 headers: {
34
35 async updateFile(repo: string, path: string, content: string, sha: string, message: string, branch: string) {
36 const response = await fetch(`https://api.github.com/repos/${repo}/contents/${path}`, {
37 method: 'PUT',
38 headers: {
59
60 async createFile(repo: string, path: string, content: string, message: string, branch: string) {
61 const url = `https://api.github.com/repos/${repo}/contents/${path}`;
62
63 let body: any = {
104
105 async getCommitHistory(repo: string, path: string, branch: string) {
106 const response = await fetch(`https://api.github.com/repos/${repo}/commits?path=${path}&sha=${branch}`, {
107 method: 'GET',
108 headers: {

ValTownAPImain.tsx6 matches

@iamseeleyUpdated 11 months ago
1export class ValTownAPI {
2 constructor(private apiKey: string) {}
3
4 async getUserID() {
5 const response = await fetch('https://api.val.town/v1/me', {
6 method: 'GET',
7 headers: {
8 'Authorization': `Bearer ${this.apiKey}`,
9 'Content-Type': 'application/json'
10 }
21 async getAllVals() {
22 const userId = await this.getUserID();
23 const response = await fetch(`https://api.val.town/v1/users/${userId}/vals`, {
24 method: 'GET',
25 headers: {
26 'Authorization': `Bearer ${this.apiKey}`,
27 'Content-Type': 'application/json'
28 }

GitHubAPIREADME.md1 match

@iamseeleyUpdated 11 months ago
1Migrated from folder: val_backup/GitHubAPI

vapi-minutes-db1 file match

@henrywilliamsUpdated 1 hour ago

vapi-minutes-db2 file matches

@henrywilliamsUpdated 3 hours 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