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=17&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 11770 results for "api"(953ms)

myApi1 file match

@gugge•Updated 1 year ago

myApi1 file match

@amirmasoudabdol•Updated 1 year ago

myApi1 file match

@charlesfrisbee•Updated 1 year ago

myApi1 file match

@x2764tech•Updated 1 year ago

myApi1 file match

@hbd•Updated 1 year ago

myApi1 file match

@chatgpt•Updated 1 year ago

myApi1 file match

@tacascer•Updated 1 year ago

myApi1 file match

@waldo•Updated 1 year ago

myApi1 file match

@nathanpower•Updated 1 year ago

myApi1 file match

@rraval•Updated 1 year ago

social_data_api_projectx_posts_search.tsx38 matches

@tsuchi_ya•Updated 56 mins ago
10 const [query, setQuery] = React.useState("");
11 const [targetAccount, setTargetAccount] = React.useState("");
12 const [apiKey, setApiKey] = React.useState("");
13 const [searchType, setSearchType] = React.useState("Latest");
14 const [sinceDate, setSinceDate] = React.useState("");
50 const fetchAllTweets = React.useCallback(
51 async (fullQuery, type, targetCount) => {
52 if (!apiKey.trim()) {
53 setError("Please enter your SocialData API Key.");
54 return;
55 }
79 }
80
81 const response = await fetch(`/api/search?${params.toString()}`, {
82 headers: { "X-Api-Key": apiKey },
83 });
84
88 const errorData = await response
89 .json()
90 .catch(() => ({ message: `API Error: ${response.statusText}` }));
91 throw new Error(
92 errorData.message
93 || `API Error: ${response.statusText} on page ${pageNum}`,
94 );
95 }
100 if (data.status === "error") {
101 throw new Error(
102 data.message || `API returned an error on page ${pageNum}`,
103 );
104 }
135 }
136 },
137 [apiKey],
138 );
139
144 return;
145 }
146 if (!apiKey.trim()) {
147 setError("Please enter your SocialData API Key.");
148 return;
149 }
176 { className: "app" },
177 React.createElement("h1", { className: "title" }, "X Search"),
178 // API Key Input
179 React.createElement(
180 "div",
185 React.createElement(
186 "label",
187 { htmlFor: "apiKey", className: "label" },
188 "API Key",
189 ),
190 React.createElement("input", {
191 type: "password",
192 id: "apiKey",
193 value: apiKey,
194 onChange: (e) => setApiKey(e.target.value),
195 placeholder: "Enter SocialData API Key",
196 className: "input",
197 }),
565 rel: "noopener noreferrer",
566 },
567 "SocialData API",
568 ),
569 " | ",
598 const url = new URL(request.url);
599
600 // Search API Proxy Endpoint
601 if (url.pathname === "/api/search" && request.method === "GET") {
602 const apiKey = request.headers.get("X-Api-Key");
603 if (!apiKey) {
604 return Response.json(
605 { status: "error", message: "API Key missing in request" },
606 { status: 400 },
607 );
619 }
620
621 const apiUrl = new URL("https://api.socialdata.tools/twitter/search");
622 apiUrl.searchParams.set("query", query);
623 apiUrl.searchParams.set("type", type);
624 if (cursor) apiUrl.searchParams.set("cursor", cursor);
625
626 try {
627 const apiResponse = await fetch(apiUrl.toString(), {
628 headers: {
629 Authorization: `Bearer ${apiKey}`,
630 Accept: "application/json",
631 },
634 let responseData;
635 try {
636 responseData = await apiResponse.json();
637 } catch (e) {
638 const text = await apiResponse.text();
639 console.error("Non-JSON response from SocialData:", text);
640 return Response.json(
641 {
642 status: "error",
643 message: `SocialData API non-JSON response: ${apiResponse.statusText}`,
644 },
645 { status: apiResponse.status },
646 );
647 }
648
649 if (!apiResponse.ok || responseData.status === "error") {
650 console.error(
651 `SocialData API Error (${apiResponse.status}):`,
652 responseData,
653 );
656 status: "error",
657 message: responseData?.message
658 || `SocialData API Error: ${apiResponse.statusText}`,
659 },
660 { status: apiResponse.status },
661 );
662 }

untitled-6344data.json1 match

@mmorihara•Updated 1 hour ago
20 "mpgc_bulls_skinned": "Bulls skinned",
21 "mpgc_burdock_root_picked": "Burdock Roots picked",
22 "mpgc_capitale_notes_collected": "Capitale notes collected",
23 "mpgc_chanterelle_picked": "Chanterelle picked",
24 "mpgc_chickens_skinned": "Chickens skinned",
apiv1
papimark21