Content pfp
Content
@
0 reply
0 recast
0 reaction

Marissa pfp
Marissa
@marissaposner
I've noticed some differences in the fuzzy matching from the @neynar user API for example: Sometimes when I type in "marissa" as the name I get @marissaposner & other times I get @marissa. Here is the query string: `/farcaster/user/search?q=${fname}&viewer_fid=3&limit=5`, Why does this happen? @rish @manan
1 reply
2 recasts
3 reactions

rish pfp
rish
@rish
you mean the ranking changes or do you mean the user you want is not on the list at all? if you always want the exact user as the input, this might be better: https://docs.neynar.com/reference/user-by-username-v1 If you have the FID, that's even better and you can use this: https://docs.neynar.com/reference/user-bulk
1 reply
0 recast
0 reaction

Marissa pfp
Marissa
@marissaposner
Yes for the FIDs it is working great but there is an instance where I only have the username. I just tried the user-by-username endpoint and you’re right it works better. Why does the /user/search endpoint not work as well?
1 reply
0 recast
0 reaction

Marissa pfp
Marissa
@marissaposner
Also the structure of the results are different between the two. For ex: in the user-by-username it is: 
 "pfp": { "url": "https://i.imgur.com/JgDFBzp.jpg" },

Vs. "pfp_url": "https://imagedelivery.net/BXluQx4ige9GuW0Ia56BHw/59668b4f-0c63-4eea-496f-b068a14b3000/original",
1 reply
0 recast
0 reaction

rish pfp
rish
@rish
user-search is a search endpoint instead of an exact match endpoint. I will have to look into why the ranking changes but what you're mentioning is inherently an exact match vs fuzzy match question and thus we have a separate endpoint for exact match you're right about the obj type change, havent gotten to moving this API to the v2 format yet. However, we have a helper function here that can convert the objects for you so you dont have to do anything on your end: https://github.com/neynarxyz/nodejs-sdk/blob/0f8206f1b343cd1cf75e68b78e1d09844c1fae77/src/neynar-api/utils/v1-to-v2-converters.ts#L8
1 reply
0 recast
0 reaction

Marissa pfp
Marissa
@marissaposner
Yeah I figured it was a difference between exact vs. fuzzy match but not sure why the ranking changes. If you figure it out, I'm curious to know why. Thanks for sending over the function.
1 reply
0 recast
0 reaction