serpapi / public-roadmap

Public Roadmap for SerpApi, LLC (https://serpapi.com)
50 stars 3 forks source link

[API Wrapper] Support TypeScript #278

Open dimitryzub opened 2 years ago

dimitryzub commented 2 years ago

This issue is to track the number of current or potential user requests for adding support for TypeScript.

Request(s) count: 1


Aug 28, 2022: I've received a potential request on Stackoverflow comment about using our API but in TypeScript.

@aliayar, @marm123 does someone wrote you about adding support for TypeScript?

Intercom conversation

ilyazub commented 2 years ago

Our regular google-search-results-nodejs works with TypeScript too: https://replit.com/@ilyazub/scrape-google-search-serpapi-typescript#src/index.ts

We don't provide type declarations but it still works.

marm123 commented 2 years ago

Yes, this is true @dimitryzub, we received such a request on Friday.

dimitryzub commented 2 years ago

@ilyazub Should we mention about it explicitly in our Node integration that it works with TypeScript with no problems?

hartator commented 2 years ago

Maybe we can release a slightly-modified version of google-search-results-nodejs in TypeScript?

Regarding type contains, I remember @jvmvik had a same issue with Go. He ended up using some sort of "DynamicType" type, interface{}. Maybe there is something similar in TypeScript.

Let's also take chance to release as searpapi-typescript for the repo name and serpapi as the lib name if we do that.

dimitryzub commented 2 years ago

@marm123 When you have time, could you please edit my initial issue comment and add a link to a potential or direct user request so we can back up this decision with data (requests count)? 💛

hartator commented 2 years ago

@marm123 When you have time, could you please edit my initial issue comment and add a link to a potential or direct user request so we can back up this decision with data (requests count)? 💛

Yes, this is true @dimitryzub, we received such a request on Friday.

Yes, can you add the Intercom thread, @marm123? Thank you.

ilyazub commented 2 years ago

@dimitryzub I've tagged you in the Intercom thread.

I've replied to this user. There's a problem with the Webpack configuration, not TypeScript.

marm123 commented 2 years ago

@dimitryzub @hartator @ilyazub Really sorry I've missed this conversation! The notification got lost in my email mailbox. Just in case this is still needed here is the intercom conversation: Intercom

I have also added it to your initial comment @dimitryzub

Once again, sorry for missing that.

richardm commented 8 months ago

I see you recently added limited support for TypesScript. It would be very helpful if you also provided type declarations indicating which fields I can expect to see returned from various engines, especially given that the response structure varies by engine, whether it's async or not, and probably many other variables. I've spent many hours this week reviewing the docs and reverse engineering the types from the responses I get for various searches. I expect this process will continue as I add additional use cases, and that wouldn't be necessary with better type support.

schaferyan commented 8 months ago

Hi Richard, thanks for your comment.

Unfortunately, we can't provide type declarations for all the fields you can expect to see returned by various engines.

The reason for this is that some of the key names are generated dynamically based on what the search engines provide. We also can never guarantee that any particular field will always be present in the response, as this depends on whether the search engines return them.

I hope that makes sense. If you have any other questions or concerns, you are always more than welcome to email us at support@serpapi.com, or contact us through the chat interface on our website, we will be happy to help.

schaferyan commented 1 month ago

Another request for TypeScript support. This user is mostly interested in a list of types:

Intercom