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%22Optional%20title%22?q=api&page=77&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 12728 results for "api"(1166ms)

social_data_api_projectproxy-api.ts23 matches

@tsuchi_yaUpdated 4 days ago
1/**
2 * SocialData API Proxy for Cloudflare Workers
3 * Acts as a backend for the X Search UI, handling API key management,
4 * and request forwarding to SocialData API.
5 *
6 * This proxy runs on Cloudflare Workers and connects to:
7 * - Supabase for authentication and user management
8 * - Cloudflare D1 for tweet storage
9 * - SocialData API for Twitter/X data
10 */
11
41 try {
42 // Supabaseの公開鍵を使ってJWTを検証するのが理想ですが、
43 // 簡易的な実装としてSupabase APIを利用して検証します
44 const supabaseUrl = env.SUPABASE_URL;
45 const supabaseKey = env.SUPABASE_SERVICE_KEY;
50 }
51
52 // Supabase Auth APIを利用してユーザー情報を取得
53 const response = await fetch(`${supabaseUrl}/auth/v1/user`, {
54 headers: {
55 "Authorization": `Bearer ${token}`,
56 "apikey": supabaseKey,
57 },
58 });
69 headers: {
70 "Authorization": `Bearer ${supabaseKey}`,
71 "apikey": supabaseKey,
72 },
73 });
104
105/**
106 * Forward request to SocialData API
107 * @param {string} query - Search query
108 * @param {string} type - Search type (Latest or Top)
113async function forwardToSocialData(query, type, cursor, env) {
114 try {
115 const apiKey = env.SOCIAL_DATA_API_KEY;
116 if (!apiKey) {
117 throw new Error("SOCIAL_DATA_API_KEY environment variable not set");
118 }
119
120 const apiUrl = new URL("https://api.socialdata.tools/twitter/search");
121 apiUrl.searchParams.set("query", query);
122 apiUrl.searchParams.set("type", type || "Latest");
123 if (cursor) {
124 apiUrl.searchParams.set("cursor", cursor);
125 }
126
127 const response = await fetch(apiUrl.toString(), {
128 headers: {
129 "Authorization": `Bearer ${apiKey}`,
130 "Accept": "application/json",
131 },
136 try {
137 const errorData = await response.json();
138 errorText = errorData.message || `API Error: ${response.statusText}`;
139 } catch {
140 errorText = `API Error: ${response.statusText}`;
141 }
142 throw new Error(errorText);
167 "Content-Type": "application/json",
168 "Authorization": `Bearer ${supabaseKey}`,
169 "apikey": supabaseKey,
170 "Prefer": "return=minimal",
171 },
344 ctx.waitUntil(incrementSearchCount(authResult.userId, env));
345
346 // Forward request to SocialData API
347 const data = await forwardToSocialData(query, type, cursor, env);
348
450 JSON.stringify({
451 status: "ok",
452 message: "SocialData API Proxy is running",
453 environment: "Cloudflare Workers",
454 }),

ipv4-counterindex.ts2 matches

@maxmUpdated 4 days ago
15await initDatabase();
16
17// API endpoint to get visit data
18app.get("/api/visits", async (c) => {
19 const visits = await getAllVisits();
20 const totalVisits = await getTotalVisits();
226
227 // Add engagement filters
228 // Always use min_ (greater than or equal to) for API filters
229 if (likesCount) {
230 finalQuery += ` min_faves:${likesCount}`;
236
237 // Note: Replies count, bookmark count, and views count might not be directly filterable
238 // in the Twitter/X API. These may need to be filtered client-side after fetching.
239
240 return finalQuery.trim();
272 maxTweets: parseInt(maxTweets),
273 filters: {
274 // These filters will be applied client-side if the API doesn't support them directly
275 // Always use "greater than or equal to" filtering
276 repliesCount: repliesCount
380 // Helper to check if a tweet meets the client-side filter criteria
381 const meetsCriteria = (tweet) => {
382 // Apply any client-side filters here that the API doesn't support
383 // Only perform "greater than or equal to" checks
384
401 }
402
403 // Apply like count filter if not handled by API
404 if (likesCount && tweet.favorite_count !== undefined) {
405 if (tweet.favorite_count < parseInt(likesCount)) return false;
406 }
407
408 // Apply retweet count filter if not handled by API
409 if (retweetsCount && tweet.retweet_count !== undefined) {
410 if (tweet.retweet_count < parseInt(retweetsCount)) return false;

ipv4-counterindex.html1 match

@maxmUpdated 4 days ago
125 document.getElementById('refresh-btn').addEventListener('click', async () => {
126 try {
127 const response = await fetch('/api/visits');
128 const data = await response.json();
129 updateUI(data);

StarterPackFeedsneynar.ts2 matches

@moeUpdated 4 days ago
1const baseUrl = '/neynar-proxy?path='
2// const baseUrl = "https://api.neynar.com/v2/farcaster/";
3
4export async function fetchNeynarGet(path: string) {
8 'Content-Type': 'application/json',
9 'x-neynar-experimental': 'true',
10 'x-api-key': 'NEYNAR_API_DOCS',
11 },
12 })

StarterPackFeedsApp.tsx3 matches

@moeUpdated 4 days ago
60 <div className="">✷ Farcaster mini app manifest + webhook + embed metadata</div>
61 <div className="">✷ Farcaster notifications (storing tokens, sending recurring notifications, ...)</div>
62 <div className="">✷ Neynar API integration for Farcaster data</div>
63 <div className="">✷ Hosted on Val Town (instant deployments on save)</div>
64 <div className="">
74
75// function Database() {
76// const queryFn = () => fetch('/api/counter/get').then((r) => r.json())
77// const { data, refetch } = useQuery({ queryKey: ['counter'], queryFn })
78// return (
80// {/* <h2 className="font-semibold">Database Example</h2> */}
81// <div className="">Counter value: {data}</div>
82// <Button variant="outline" onClick={() => fetch('/api/counter/increment').then(refetch)}>
83// Increment
84// </Button>

StarterPackFeedsneynar.ts4 matches

@moeUpdated 4 days ago
1const NEYNAR_API_KEY = Deno.env.get("NEYNAR_API_KEY") || "NEYNAR_API_DOCS";
2const headers = {
3 "Content-Type": "application/json",
4 "x-api-key": NEYNAR_API_KEY,
5};
6
7export const fetchGet = async (path: string) => {
8 return await fetch("https://api.neynar.com/v2/farcaster/" + path, {
9 method: "GET",
10 headers: headers,
13
14export const fetchPost = async (path: string, body: any) => {
15 return await fetch("https://api.neynar.com/v2/farcaster/" + path, {
16 method: "POST",
17 headers: headers,

reelMitrajsREADME.md2 matches

@OmyadavUpdated 4 days ago
2 const prompt = `Generate a short 15-second Instagram reel script and 5 viral hashtags for the topic: "${topic}". Make the script engaging and desi style.`;
3
4 const res = await fetch("https://api.openai.com/v1/chat/completions", {
5 method: "POST",
6 headers: {
7 "Authorization": `Bearer ${Deno.env.get("OPENAI_API_KEY")}`,
8 "Content-Type": "application/json",
9 },

untitled-509README.md2 matches

@OmyadavUpdated 4 days ago
2 const prompt = `Generate a short 15-second Instagram reel script and 5 viral hashtags for the topic: "${topic}". Make the script engaging and desi style.`;
3
4 const res = await fetch("https://api.openai.com/v1/chat/completions", {
5 method: "POST",
6 headers: {
7 "Authorization": `Bearer ${Deno.env.get("OPENAI_API_KEY")}`,
8 "Content-Type": "application/json",
9 },

resume-parserresumeSchemas.ts46 matches

@prashamtrivediUpdated 4 days ago
1import {z} from 'npm:@hono/zod-openapi'
2import {ZodObject, ZodType, ZodTypeAny} from "npm:zod"
3
31
32 // Create new object schema with additionalProperties: false and all fields required
33 return z.object(newShape).openapi({
34 // Preserve description and example if they exist
35 ...(schema._def.openapi ? {
36 description: schema._def.openapi.description,
37 example: schema._def.openapi.example
38 } : {}),
39 // Always add additionalProperties: false
44 // Process array items, removing all array constraints
45 // This removes: minItems, maxItems, uniqueItems validation
46 return z.array(processSchema(schema._def.type)).openapi({
47 // Preserve description and example if they exist
48 ...(schema._def.openapi ? {
49 description: schema._def.openapi.description,
50 example: schema._def.openapi.example
51 } : {})
52 })
54 else if (schema instanceof z.ZodString) {
55 // Remove ALL string validations (min, max, regex, email, url, etc.)
56 return z.string().openapi({
57 // Preserve description and example if they exist
58 ...(schema._def.openapi ? {
59 description: schema._def.openapi.description,
60 example: schema._def.openapi.example
61 } : {})
62 })
64 else if (schema instanceof z.ZodNumber) {
65 // Remove ALL number validations (min, max, multipleOf, int, etc.)
66 return z.number().openapi({
67 // Preserve description and example if they exist
68 ...(schema._def.openapi ? {
69 description: schema._def.openapi.description,
70 example: schema._def.openapi.example
71 } : {})
72 })
74 else if (schema instanceof z.ZodBoolean) {
75 // Preserve boolean as is
76 return z.boolean().openapi({
77 // Preserve description and example if they exist
78 ...(schema._def.openapi ? {
79 description: schema._def.openapi.description,
80 example: schema._def.openapi.example
81 } : {})
82 })
93 // Preserve enums and literals but without additional constraints
94 // Convert them to strings for maximum compatibility
95 return z.string().openapi({
96 // Preserve description and example if they exist
97 ...(schema._def.openapi ? {
98 description: schema._def.openapi.description,
99 example: schema._def.openapi.example
100 } : {})
101 })
119 z.object({
120 value: valueSchema,
121 confidence: z.number().min(0).max(1).openapi({
122 description: 'Confidence score between 0 and 1',
123 example: 0.95
124 }),
125 standardization: z.string().nullable().openapi({
126 description: 'Notes about any standardization applied',
127 example: 'Standardized from "JS" to "JavaScript"'
135 durationInMonths: ConfidenceFieldSchema(z.number().nullable()),
136 current: ConfidenceFieldSchema(z.boolean())
137}).openapi('DateRange')
138
139// Request schema
140export const ResumeParserRequestSchema = z.object({
141 resumeText: z.string().min(1).openapi({
142 description: 'The raw text of the resume to parse',
143 example: 'John Doe\nSoftware Engineer\n...'
144 }),
145 options: z.object({
146 confidenceThreshold: z.number().min(0).max(1).optional().openapi({
147 description: 'Minimum confidence score threshold (0-1)',
148 example: 0.5
149 }),
150 standardizationEnabled: z.boolean().optional().openapi({
151 description: 'Whether to standardize terminology',
152 example: true
153 }),
154 extractSummary: z.boolean().optional().openapi({
155 description: 'Whether to extract and analyze the resume summary',
156 example: true
157 }),
158 sectionPriorities: z.array(z.string()).optional().openapi({
159 description: 'Sections to prioritize in extraction',
160 example: ['skills', 'workExperience']
161 }),
162 extractLanguages: z.boolean().optional().openapi({
163 description: 'Whether to extract language proficiencies',
164 example: true
165 })
166 }).optional().openapi({
167 description: 'Parser configuration options'
168 })
169}).openapi('ResumeParserRequest')
170
171// Personal info schema
179 website: ConfidenceFieldSchema(z.string().nullable()),
180 summary: ConfidenceFieldSchema(z.string().nullable())
181}).openapi('PersonalInfo')
182
183// Skill schema
187 proficiency: ConfidenceFieldSchema(z.string().nullable()),
188 yearsOfExperience: ConfidenceFieldSchema(z.number().nullable())
189}).openapi('Skill')
190
191// Work experience schema
198 technologies: ConfidenceFieldSchema(z.array(z.string())),
199 achievements: ConfidenceFieldSchema(z.array(z.string()))
200}).openapi('WorkExperience')
201
202// Education schema
209 coursework: ConfidenceFieldSchema(z.array(z.string()).nullable()),
210 achievements: ConfidenceFieldSchema(z.array(z.string()).nullable())
211}).openapi('Education')
212
213// Project schema
219 dates: ConfidenceFieldSchema(DateRangeSchema.nullable()),
220 role: ConfidenceFieldSchema(z.string().nullable())
221}).openapi('Project')
222
223// Certification schema
228 expiryDate: ConfidenceFieldSchema(z.string().nullable()),
229 id: ConfidenceFieldSchema(z.string().nullable())
230}).openapi('Certification')
231
232// Language schema
234 name: ConfidenceFieldSchema(z.string()),
235 proficiency: ConfidenceFieldSchema(z.string().nullable())
236}).openapi('Language')
237
238// Parsed resume schema
248 missingFields: z.array(z.string()),
249 detectedSections: z.array(z.string())
250}).openapi('ParsedResume')
251
252// Response schema
259 details: z.unknown().optional()
260 }).optional()
261}).openapi('ParseResumeResponse')
262
263// Error response schema
269 details: z.unknown().optional()
270 })
271}).openapi('ErrorResponse')
272//Simplified ConfidenceFieldSchema
273export const SimplifiedConfidenceFieldSchema = <T extends z.ZodTypeAny>(valueSchema: T) =>

vapi-minutes-db1 file match

@henrywilliamsUpdated 19 hours ago

vapi-minutes-db2 file matches

@henrywilliamsUpdated 21 hours ago
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
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com